/* A Mac desktop at real scale: Liquid Glass chrome over a wallpaper that follows the time of day.
   Menus and windows are light and translucent (vibrancy), so the wallpaper's tint shows through them. */

/* The sky color is registered, so a change of time of day fades instead of jumping. */
@property --sky1 { syntax: "<color>"; inherits: true; initial-value: #3d8bef; }

:root {
  --ink: #1d1d1f;
  --ink-2: #48484d;
  --ink-3: #6e6e73;
  --rule: rgb(0 0 0 / 0.1);
  --tint: rgb(0 0 0 / 0.05);
  --tint-strong: rgb(0 0 0 / 0.09);
  --surface: #ffffff;
  --paper: #f5f5f7;
  --link: #0066cc;
  --blue: #0a84ff;
  --blue-fill: #0071e3;
  --blue-fill-hover: #0068d1;
  --select: #0a64d6;
  --red: #ff3b30;

  /* Liquid Glass: light, saturated, with a bright edge where light catches the material. */
  --glass-menu: rgb(246 246 250 / 0.7);
  --glass-window: rgb(250 250 252 / 0.82);
  --glass-blur: blur(36px) saturate(1.9);
  --glass-edge: rgb(255 255 255 / 0.55);
  --glass-line: rgb(0 0 0 / 0.12);
  --shadow-window: 0 30px 70px rgb(0 0 0 / 0.3), 0 8px 22px rgb(0 0 0 / 0.14), 0 0 0 0.5px rgb(0 0 0 / 0.22);
  --shadow-menu: 0 14px 34px rgb(0 0 0 / 0.22), 0 0 0 0.5px rgb(0 0 0 / 0.18);

  --menubar: 24px;
  --si-gap: 0px;
  --si-pad: 6px;
  --dock-icon: 48px;
  --radius-window: 16px;
  --radius-menu: 8px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-ui: cubic-bezier(0.23, 1, 0.32, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
  transition: --sky1 2s;
}

/* ——— Times of day. The menu bar's text turns white over the dark ones, as it does on a Mac. ——— */

[data-time="dawn"] {
  --dock-dot: rgb(40 20 50 / 0.6);
  --sky1: #8a92d6; --wallpaper: url("assets/wallpaper/dawn.webp");
  --mb-ink: #1d1d1f; --mb-glass: rgb(255 255 255 / 0.22); --mb-hover: rgb(0 0 0 / 0.1); --desk-glow: rgb(70 30 60 / 0.72);
}
[data-time="day"] {
  --dock-dot: rgb(0 20 60 / 0.6);
  --sky1: #3d8bef; --wallpaper: url("assets/wallpaper/day.webp");
  --mb-ink: #1d1d1f; --mb-glass: rgb(255 255 255 / 0.24); --mb-hover: rgb(0 0 0 / 0.1); --desk-glow: rgb(5 30 80 / 0.75);
}
[data-time="dusk"] {
  --dock-dot: rgb(255 255 255 / 0.85);
  --sky1: #1b2160; --wallpaper: url("assets/wallpaper/dusk.webp");
  --mb-ink: #ffffff; --mb-glass: rgb(20 10 40 / 0.18); --mb-hover: rgb(255 255 255 / 0.2); --desk-glow: rgb(20 5 30 / 0.6);
}
[data-time="night"] {
  --dock-dot: rgb(255 255 255 / 0.85);
  --sky1: #02061a; --wallpaper: url("assets/wallpaper/night.webp");
  --mb-ink: #ffffff; --mb-glass: rgb(0 0 20 / 0.2); --mb-hover: rgb(255 255 255 / 0.2); --desk-glow: rgb(0 0 10 / 0.6);
}
/* Scrolled past the desktop onto the white list: the menu bar goes light, so it stays readable. */
.is-paper { --mb-ink: #1d1d1f; --mb-glass: rgb(246 246 248 / 0.8); --mb-hover: rgb(0 0 0 / 0.1); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--menubar) + 24px); background: var(--sky1); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgb(0 113 227 / 0.22); }
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }
kbd { font: inherit; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* SF Symbol-like glyphs: one stroke weight everywhere, filled parts set per path. */
.glyph {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

.skip {
  position: fixed; left: 12px; top: -48px; z-index: 100;
  padding: 8px 14px; border-radius: 999px;
  background: var(--blue-fill); color: #fff; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 34px; }

/* The intro (motion.js) takes these over; until then they wait unseen, so nothing flashes first. */
.intro .menubar, .intro .dock, .intro .desk-icons, .intro .window, .intro .hint { visibility: hidden; }

/* ——— The desktop and its wallpaper ——— */

.desktop {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}
.wallpaper {
  position: absolute; inset: 0; z-index: -1;
  background: var(--sky1) var(--wallpaper-placeholder) center / cover no-repeat;
}
/* Two layers, so a new time of day fades in over the old one. Only the current palette's image downloads:
   the first layer takes it from CSS before the scripts run; site.js swaps images in after that. */
.wallpaper__layer {
  position: absolute; inset: 0;
  /* The light and the folds sit right of center; keep them in view when a phone crops the sides. */
  background: center 60% / cover no-repeat;
  transition: opacity 1.2s var(--ease-ui);
}
.wallpaper__layer:first-child { background-image: var(--wallpaper); }
.wallpaper__layer + .wallpaper__layer { opacity: 0; }
@media (max-width: 700px) { .wallpaper, .wallpaper__layer { background-position: 68% 60%; } }

/* Wallpaper placeholders, written by art/render.sh. */
[data-time="dawn"] { --wallpaper-placeholder: url(data:image/webp;base64,UklGRmYBAABXRUJQVlA4IFoBAACQCwCdASpAACkAPqU6m0mmIyKhNV36AMAUiWIApLPUfXPzlP9cxVmjvoDnOnuX3ox/+j1T6klSxSugv/RGH3aKFcLN9cnh1fQSNI4mO/OeSk4Y0ZGBpCgswfWrcPBe+GGTvInv6AD+i6W0eKaoD9IwfJvlx76575eWEHpM+uA1HIZQZlBRQhY5XoD1XKUdXxTGMgu5PAxhMQe4yCEz3kz0Pw2KVnXNDVMHIkinaKyLExoxHEJqcgIYpoUaaPEmTiYjVTTAIcFIjox0kVHx5XfQ1BblpbU7qBjcueCjAm8U2bBY0yic1X7NtssYNZ2pd1Q3C8HkQDbyy3bfXv0OQFhbkOLEVkuq2ZSmkcI9gWOCFxwJOuIT8MnfPxjXpzIDcvYL/98hOyjUcyJUL/a1uL6K8popdagU6vb8SiZtc6xVa+v+Tch1FHDc0P53hoYGfy8rDbRk5uNAAAAA); }
[data-time="day"] { --wallpaper-placeholder: url(data:image/webp;base64,UklGRpIBAABXRUJQVlA4IIYBAACwCwCdASpAACkAPrVOnkqnJKKhrVmaSOAWiWQAnTnRVf5ejw3WGf/XNLYv76RjAWJ6GMXF0anuBkkpWyF0FwsEN2I3qact3Hzc5nLr7ACGjM+Z5syR37ZssftKnE+uggSUSk5wE+AA3yeHPt19tfqQb+Ic7aFU7vtvrbW2inOEfuM7O94V1uB8+tsnuj0ksm+RzKnz1rhnS5AlJ1KqkN4/yd4O1znwgFdApcfhE8TEnC++rcFors5fSlw+vYUFIPlNPCJ+Pc4CplROk/Y1v/9XFI7TUpPtdDrhQV6iyyyI3HWGJdEhYAgnIoTco4MfnQUjmwd//lHp61toN1iC9nKLHFo5ByPKEv9LhTIHlN8zJYl8IdHVcUPr8I4RxWtsdiwz5xJ5WRXbOHwCFC9x9jdv/Cmvh6kFUsWkwmnYqGnd9F1eW3bGtCyL72tFL4GnBgu0xbXkH8odmP+i8DxSUxdYmuMPNjsSNmNVXmzIPQ52qid0oXc36muJjOX8YnRe88IP0igAAAA=); }
[data-time="dusk"] { --wallpaper-placeholder: url(data:image/webp;base64,UklGRpwBAABXRUJQVlA4IJABAABwCwCdASpAACkAPqlEm0mmJCKhMrkuYMAVCWgAnTNjxkALf/8cL8A6P8t3+T7eR/CUDwtIROjUQhGAFQVeUqyrSi+ECEGeV53s0Ux32y49LRiO3Bq1Lgv/2svdE/7f59NKAVgAAP70UQ9oaZoDKEYqYC39HQtpetMxBg/XoNdwecKFf6nK8UJZjWynG+aNo9pkos/qFCfdWJ+qsgQlfTFch/RG5WtHB+00+ILwvwbVdIEtkzcUy73G1/vC2m6UO8CdjpP8IVnJroc9uYpjkRdd9KX50p2wCu02cSTytXIpBdcvPhukaJkLYWLo8pCf+rM+9xOKrfCBkCV7fwL3UdM3oY4jBjnK4eHndwguDSnCdqd/z4F3fXXgEn9+vIU72aFU9GWZgx4MhcbLPowwmXW/agFxWEzPp/jgSA1WbGD7EYDNfzdpzj2w/ybLurzJXkV+X9pbv9vR5Zt4aWr3PW0bJ/poNUutxT3gDGpBy+HJdEpxlho7JDOW0d/8P8K8qQ7buiUt283gkQc12gMLO8AA); }
[data-time="night"] { --wallpaper-placeholder: url(data:image/webp;base64,UklGRmwBAABXRUJQVlA4IGABAACQCgCdASpAACkAPqlMnEmmJSMhMBgOqMAVCWQAv2uufB/w8NOk52UR+sQCPl5KytXz83S50tqAHz9g3/zoOhtz4J6z9v/vpkr2M46FjHseouR1YzjXyV21owoOd0AA/vnALH62lVEV0N/IfqxO7lFkt4nVfL5dzxMWwPjWKuOl4KjFRS9Uu/lc+EkXKmYc9fk37OvsrXsKdAKaRMIBe70EGem13zAb2lSyXzT3gp7Fallkakv/aAZxgYh3Ilmn5W2PDj78z7zva975LAorLmUYHZH9UelNXXnCZK9SNEQMf3PvmuwhXfrVZOg5/36LGbe4V+I+RvauIgGKbCBxd+pBCrYvRkiwVtAiQ0TjVZ8nfg27DKoxvoOeoGoIsOWgIt11GEUbz06Fczxh9q6ezcHUNnIcE2+CN1rHevnVJy27TSbrZT7Pp0g++sX0wvsoY7/9iItZrug3V8EbDPRNKuAA); }
/* End of wallpaper placeholders. */

/* ——— Menu bar, at the Mac's own scale ——— */

.menubar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--menubar);
  display: flex;
  align-items: center;
  padding: 0 8px 0 10px;
  color: var(--mb-ink);
  background: var(--mb-glass);
  backdrop-filter: blur(30px) saturate(1.8);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  font-size: 13px;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.4s, background-color 0.4s;
}
.menubar__menus { display: flex; align-items: center; min-width: 0; overflow: hidden; flex: none; }
.menubar__menus a {
  display: flex; align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 5px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
  cursor: default;
}
.menubar__menus a:hover, .menubar__menus a.is-open { background: var(--mb-hover); }
.menubar__mark { padding: 0 10px !important; }
.menubar__mark .glyph { width: 14px; height: 14px; }
.menubar__app { font-weight: 700 !important; }

/* Empty menu bar space: Drawer listens here for clicks, hovers and scrolls, like the real one. */
.menubar__space { flex: 1; align-self: stretch; min-width: 12px; }
.menubar__extras { display: flex; align-items: center; gap: var(--si-gap); flex: none; transition: gap 0.3s var(--ease-ui); }

/* A status item. Hidden ones fold to nothing, the way Drawer pushes them out of the real menu bar. */
.si {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  max-width: 240px;
  padding: 0 var(--si-pad);
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  cursor: default;
  transition: max-width 0.45s var(--ease-ui), padding 0.45s var(--ease-ui), opacity 0.3s, background-color 0.12s;
}
.si:hover, .si[aria-expanded="true"] { background: var(--mb-hover); }
.si .glyph { width: 15px; height: 15px; }
.si__title { font-variant-numeric: tabular-nums; }
.si__title:empty { display: none; }
.si.is-hidden, .si.is-quit { max-width: 0; padding-inline: 0; opacity: 0; pointer-events: none; }
.si.is-quit { display: none; }
.si.is-muted { color: var(--red); }
.si.is-paused { opacity: 0.4; }
.si.is-dragging { background: var(--mb-hover); opacity: 0.8; cursor: grabbing; }
.si--divider { padding: 0 3px; }
.si--divider .glyph { width: 7px; }
.menubar__system { margin-left: 2px; }
.menubar__clock {
  margin-left: 6px;
  padding: 0 4px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ——— Menus, like NSMenu: translucent and tinted by what's behind them ——— */

.menu {
  position: fixed;
  z-index: 80;
  min-width: 220px;
  max-width: 340px;
  max-height: calc(100svh - var(--menubar) - 24px);
  overflow-y: auto;
  padding: 5px;
  border-radius: var(--radius-menu);
  background: var(--glass-menu);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-menu), inset 0 0 0 1px var(--glass-edge);
  font-size: 13px;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 22px;
  padding: 2px 10px 2px 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  cursor: default;
}
.menu__item:focus { outline: none; }
.menu__item:not(:disabled):hover, .menu__item:not(:disabled):focus-visible, .menu__item.is-open { background: var(--blue-fill); color: #fff; }
.menu__item:disabled { color: rgb(0 0 0 / 0.42); opacity: 1; }
.menu__check { width: 12px; flex: none; font-size: 12px; }
.menu__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.menu__key { color: var(--ink-3); letter-spacing: 0.06em; }
.menu__item:hover .menu__key, .menu__item:focus-visible .menu__key { color: rgb(255 255 255 / 0.8); }
.menu__arrow { font-size: 10px; opacity: 0.7; }
.menu__image { display: grid; place-items: center; width: 16px; height: 16px; flex: none; }
.menu__image .glyph { width: 14px; height: 14px; }
.menu__swatch { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.15); }
.menu__sep { height: 1px; margin: 4px 8px; background: rgb(0 0 0 / 0.1); }
/* ⌥ swaps an item for its alternate, as in Zones' Remove. */
.menu__alt { display: none; }
.menu.is-alt [data-has-alt] .menu__label--main { display: none; }
.menu.is-alt [data-has-alt] .menu__alt { display: inline; }

/* ——— Popovers ——— */

.popover {
  position: fixed;
  z-index: 70;
  border-radius: 16px;
  background: var(--glass-window);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-window), inset 0 0 0 1px var(--glass-edge);
  font-size: 13px;
  overflow: hidden;
}
.popover:focus { outline: none; }
.popover__body { width: 100%; height: 100%; }
.pop-empty {
  display: grid; place-content: center; justify-items: center; gap: 6px;
  height: 100%; padding: 24px; text-align: center; color: var(--ink-3);
}
.pop-empty b { color: var(--ink); font-size: 14px; }
.pop-empty .glyph { width: 32px; height: 32px; stroke-width: 1.3; color: var(--ink-3); margin-bottom: 4px; }
.pop-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 26px; padding: 3px 13px;
  border: 0; border-radius: 999px;
  background: var(--tint-strong);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
}
.pop-button:hover { background: rgb(0 0 0 / 0.13); }
.pop-button--blue { background: var(--blue-fill); color: #fff; }
.pop-button--blue:hover { background: var(--blue-fill-hover); }
.pop-borderless { border: 0; background: none; padding: 4px; border-radius: 6px; cursor: pointer; color: var(--ink-2); }
.pop-borderless:hover { background: var(--tint-strong); }

/* Week */
.week { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.week__head { display: flex; align-items: center; gap: 4px; }
.week__head h3 { flex: 1; font-size: 15px; }
.week__today { color: var(--blue-fill); font-size: 13px; }
.week__grid { display: grid; grid-template-columns: 26px repeat(7, 1fr); gap: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.week__grid span { display: grid; place-items: center; height: 28px; font-size: 14px; }
.week__grid .is-dow { height: 18px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.week__grid .is-wk { font-size: 11px; font-weight: 700; color: var(--blue-fill); }
.week__grid .is-wk.is-dow { color: #8e8e93; }
.week__grid .is-out { color: #8e8e93; }
.week__grid .is-today { width: 28px; margin: auto; border-radius: 50%; background: var(--blue-fill); color: #fff; font-weight: 600; }

/* Mirror */
.mirror { position: relative; height: 100%; background: #000; color: #fff; }
.mirror video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.mirror .pop-empty { position: absolute; inset: 0; color: rgb(255 255 255 / 0.75); }
.mirror .pop-empty b { color: #fff; }
.mirror .pop-empty .glyph { color: rgb(255 255 255 / 0.75); }

/* Shelf */
.shelf { display: flex; flex-direction: column; height: 100%; }
.shelf.is-over { box-shadow: inset 0 0 0 3px var(--blue); }
.shelf__list { flex: 1; overflow-y: auto; margin: 0; padding: 8px; list-style: none; }
.shelf__row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.shelf__row:hover { background: var(--tint); }
.shelf__row .glyph { width: 26px; height: 26px; stroke-width: 1.3; color: var(--ink-3); }
.shelf__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf__foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--ink-3); }

/* Scrub */
.scrub { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.scrub label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.field {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--surface);
  font: 13px/1.4 var(--mono);
  color: var(--ink);
  resize: none;
}
.field:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: transparent; }
.scrub__out { min-height: 40px; padding: 8px 10px; border-radius: 9px; background: var(--tint); font: 13px/1.4 var(--mono); word-break: break-all; }
.scrub__out.is-clean { background: rgb(52 199 89 / 0.14); }
.scrub__removed { display: flex; flex-wrap: wrap; gap: 4px; min-height: 20px; margin: 0; padding: 0; list-style: none; }
.scrub__removed li { padding: 1px 7px; border-radius: 999px; background: rgb(255 59 48 / 0.1); color: #c4211b; font: 11.5px var(--mono); text-decoration: line-through; }
.scrub__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-3); }

/* Beam */
.beam { display: flex; flex-direction: column; align-items: center; gap: 12px; height: 100%; padding: 18px; }
.beam__code { display: grid; place-items: center; width: 196px; height: 196px; padding: 12px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--rule); }
.beam__code svg { width: 100%; height: 100%; display: block; }
.beam__code .pop-empty { padding: 0; font-size: 13px; }
.beam .field { height: 54px; }
.beam__row { display: flex; gap: 8px; align-self: stretch; justify-content: center; }

/* Control Center: the wallpaper's time of day */
.control { display: grid; gap: 10px; padding: 12px; }
.control h3 { font-size: 13px; font-weight: 600; }
.control__times { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.control__time {
  display: grid; justify-items: center; gap: 5px;
  padding: 0; border: 0; background: none; font-size: 11px; color: var(--ink-2); cursor: pointer;
}
.control__swatch {
  width: 44px; height: 30px; border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
}
.control__time[aria-pressed="true"] .control__swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--blue-fill); }
.control__time[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.control p { margin: 0; font-size: 11.5px; color: var(--ink-3); }

/* ——— Desktop icons, Finder style ——— */

.desk-icons {
  position: absolute;
  top: calc(var(--menubar) + 12px);
  right: 10px;
  z-index: 1;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.desk-icon {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 92px;
  padding: 4px 2px;
  color: #fff;
  text-decoration: none;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
.desk-icon:focus-visible { outline: none; }
.desk-icon__art { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 8px; }
.desk-icon__art img { width: 60px; height: 60px; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.25)); }
.desk-icon__name {
  max-width: 100%;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  text-shadow: 0 1px 2px var(--desk-glow), 0 0 6px var(--desk-glow);
}
.desk-icon.is-selected .desk-icon__art, .desk-icon:focus-visible .desk-icon__art { background: rgb(0 0 0 / 0.22); }
.desk-icon.is-selected .desk-icon__name, .desk-icon:focus-visible .desk-icon__name { background: var(--select); text-shadow: none; }

/* A Tahoe-style folder, drawn: a blue back with a tab, a lighter front, the contents' glyph pressed in. */
.folder { position: relative; }
.folder::before, .folder::after { content: ""; position: absolute; left: 4px; right: 4px; border-radius: 6px; }
.folder::before {
  top: 10px; height: 44px;
  background: linear-gradient(#4fa8f5, #2b86e3);
  clip-path: polygon(0 0, 38% 0, 46% 14%, 100% 14%, 100% 100%, 0 100%);
}
.folder::after {
  top: 18px; height: 38px;
  background: linear-gradient(#8fd0ff, #57aef4);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.2), inset 0 1px 0 rgb(255 255 255 / 0.6);
}
.folder .glyph { position: relative; z-index: 1; width: 22px; height: 22px; margin-top: 14px; color: rgb(20 80 160 / 0.55); stroke-width: 1.8; }
.paper span {
  display: block; width: 44px; height: 56px; border-radius: 3px;
  background:
    linear-gradient(transparent 0 14px, rgb(0 0 0 / 0.14) 14px 15px, transparent 15px 20px, rgb(0 0 0 / 0.14) 20px 21px, transparent 21px 26px, rgb(0 0 0 / 0.14) 26px 27px, transparent 27px 32px, rgb(0 0 0 / 0.14) 32px 33px, transparent 33px) 7px 0 / 30px 100% no-repeat,
    #fff;
  box-shadow: 0 2px 5px rgb(0 0 0 / 0.25);
  clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
}

/* Points up at the menu bar's icons: "these are real". */
.hint {
  position: absolute;
  top: calc(var(--menubar) + 6px);
  right: clamp(250px, 24vw, 330px);
  z-index: 1;
  margin: 0;
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 13px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 3px var(--desk-glow);
  transition: opacity 0.6s;
}
.hint.is-done { opacity: 0; }
.hint svg { width: 20px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px var(--desk-glow)); }

/* ——— App icons: the rendered art (Topside's from topside/docs/src/icons.html, Snicker's and Orrery's own). Each has the
   macOS icon grid's transparent margin, so it's scaled up to fill its box like the other icons around it. ——— */

.appicon { display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(1.18); }

/* ——— Buttons ——— */

.button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 30px; padding: 5px 16px;
  border: 0; border-radius: 999px;
  background: var(--blue-fill); color: #fff;
  font-size: 13px; font-weight: 600; text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, scale 0.15s var(--ease-ui);
}
.button:hover { background: var(--blue-fill-hover); text-decoration: none; }
.button:active { scale: 0.97; }
.button--glass { background: rgb(0 0 0 / 0.07); color: var(--ink); box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.12); }
.button--glass:hover { background: rgb(0 0 0 / 0.11); }
.button--quiet { background: transparent; color: var(--link); padding-inline: 2px; font-weight: 500; }
.button--quiet:hover { background: transparent; text-decoration: underline; }
.button kbd { opacity: 0.6; font-weight: 500; }

/* The honest state for downloads that don't exist yet. */
.soon {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 5px 14px 5px 10px;
  border-radius: 999px;
  background: rgb(255 149 0 / 0.14);
  color: #8a4b00;
  font-size: 13px; font-weight: 600;
}
.soon .glyph { width: 15px; height: 15px; }

/* ——— Windows: vibrancy, so the wallpaper's tint shows through ——— */

.window {
  position: absolute;
  left: max(24px, 7vw);
  top: calc(var(--menubar) + 8vh);
  z-index: 20;
  width: min(520px, calc(100vw - 48px));
  max-height: calc(100svh - var(--menubar) - 120px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-window);
  background: var(--glass-window);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-window), inset 0 0 0 1px var(--glass-edge);
  overflow: hidden;
}
.window:focus { outline: none; }
.window.is-minimized { display: none; }
.window.is-zooming { transition: left 0.35s var(--ease-out), top 0.35s var(--ease-out), width 0.35s var(--ease-out), height 0.35s var(--ease-out), max-height 0.35s var(--ease-out); }
.window__bar {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px; flex: none;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.window__lights { display: flex; gap: 8px; min-width: 52px; }
.light {
  display: grid; place-items: center;
  width: 12px; height: 12px; padding: 0;
  border: 0; border-radius: 50%;
  background: #cfcfd4;
  box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.18);
  color: transparent;
  cursor: default;
}
.light svg { width: 8px; height: 8px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; }
.window.is-front .light--close, .window__lights:hover .light--close { background: #ff5f57; }
.window.is-front .light--min, .window__lights:hover .light--min { background: #febc2e; }
.window.is-front .light--zoom, .window__lights:hover .light--zoom { background: #28c840; }
/* The glyphs show while the pointer is over the three, as on a Mac. */
.window__lights:hover .light, .light:focus-visible { color: rgb(0 0 0 / 0.55); }
.light:focus-visible { outline-offset: 1px; border-radius: 50%; }
.window__title { flex: 1; text-align: center; margin-right: 60px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window:not(.is-front) .window__title { color: var(--ink-3); }
.window__body { padding: 2px 22px 22px; overflow-y: auto; font-size: 13px; }
.window__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.window__icon { width: 64px; height: 64px; flex: none; }
.window__icon img { width: 100%; height: 100%; }
.window__head h2 { font-size: 22px; letter-spacing: -0.02em; font-weight: 700; }
.window__head p { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; }
.window__more { color: var(--ink-2); font-size: 13.5px; }
.window__more p { margin: 0 0 9px; }
.window__more ul { margin: 0 0 9px; padding-left: 1.15em; }
.window__more li { margin-bottom: 4px; }
.window__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }

/* The Read Me: a TextEdit document, and the page's headline. */
.window--doc { width: min(560px, calc(100vw - 48px)); }
.doc { padding: 6px 30px 26px; font-size: 14px; color: var(--ink-2); }
.doc h1 {
  margin: 4px 0 14px;
  font-size: clamp(26px, 1.2rem + 1.6vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--ink);
}
.doc p { margin: 0 0 10px; }
.doc b { color: var(--ink); }
.doc__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 16px; }
.doc__sign { color: var(--ink-3); font-size: 12.5px; }

/* A Finder window: an icon view of the folder's apps. */
/* The portfolio's browser window: a Safari-like toolbar, then the live site edge to edge. */
.window--browser { width: min(1120px, calc(100vw - 96px)); height: min(760px, calc(100svh - var(--menubar) - 140px)); }
.window--browser .window__body { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 0; overflow: hidden; }
.browser__bar { display: flex; align-items: center; gap: 8px; padding: 0 12px 10px; }
.browser__address {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  height: 28px; border-radius: 8px;
  background: rgb(0 0 0 / 0.06); color: var(--ink-2); font-size: 13px;
}
.browser__address .glyph { width: 12px; height: 12px; }
.browser__button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); }
.browser__button:hover { background: rgb(0 0 0 / 0.06); }
.browser__button .glyph { width: 16px; height: 16px; }
.browser__page { flex: 1; width: 100%; min-height: 0; border: 0; background: #e7e4df; }
.finder__note { margin: 0 0 12px; color: var(--ink-2); font-size: 13px; }
.finder__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px 4px; margin: 0; padding: 0; list-style: none; }
.finder__item {
  display: grid; justify-items: center; gap: 4px;
  width: 100%; padding: 6px 2px;
  border: 0; border-radius: 8px; background: none;
  font-size: 12px; cursor: default;
}
.finder__item .appicon { width: 52px; height: 52px; }
.finder__item span:last-child { padding: 0 5px; border-radius: 4px; }
.finder__item:focus-visible { outline: none; }
.finder__item.is-selected, .finder__item:focus-visible { background: rgb(0 0 0 / 0.07); }
.finder__item.is-selected span:last-child, .finder__item:focus-visible span:last-child { background: var(--select); color: #fff; }

/* ——— Dock: a small glass shelf; icons grow up out of it, the shelf stays put ——— */

.dock {
  position: fixed;
  left: 50%;
  bottom: 6px;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: calc(var(--dock-icon) + 14px);
  padding: 0 7px 7px;
  border-radius: 20px;
  translate: -50% 0;
  background: rgb(255 255 255 / 0.2);
  backdrop-filter: blur(24px) saturate(2);
  -webkit-backdrop-filter: blur(24px) saturate(2);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.22), inset 0 0 0 1px rgb(255 255 255 / 0.32), inset 0 1px 0 rgb(255 255 255 / 0.55);
}
/* The specular edge: light catching the top of the glass. */
.dock::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.32), rgb(255 255 255 / 0) 45%);
  pointer-events: none;
}
.dock__item {
  position: relative;
  display: block;
  width: var(--dock-icon);
  height: var(--dock-icon);
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: default;
}
.dock__item > .appicon, .dock__item > .dock__art { display: block; width: 100%; height: 100%; }
.dock__item:focus-visible { outline-offset: 3px; border-radius: 12px; }
/* A dot under every running app. */
.dock__item.is-running::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 4px; height: 4px;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--dock-dot);
}
/* The label: a small dark pill above the icon. */
.dock__item::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  translate: -50% 3px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgb(30 30 32 / 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, translate 0.15s var(--ease-out);
}
.dock__item:hover::after, .dock__item:focus-visible::after { opacity: 1; translate: -50% 0; }
.dock__divider { width: 1px; height: calc(var(--dock-icon) - 6px); margin: 0 5px 3px; background: rgb(0 0 0 / 0.16); align-self: flex-end; box-shadow: 1px 0 0 rgb(255 255 255 / 0.25); }

/* A minimized window: its miniature, badged with what it belongs to. */
.dock__thumb .dock__art {
  position: relative;
  border-radius: 6px;
  background: var(--glass-window);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.25), inset 0 0 0 0.5px rgb(0 0 0 / 0.15);
  overflow: hidden;
}
.dock__art::before {
  content: "";
  position: absolute;
  left: 5px; top: 5px;
  width: 16px; height: 4px;
  background: radial-gradient(circle 2px at 2px 2px, #ff5f57 98%, transparent), radial-gradient(circle 2px at 8px 2px, #febc2e 98%, transparent), radial-gradient(circle 2px at 14px 2px, #28c840 98%, transparent);
}
.dock__art i { position: absolute; left: 6px; right: 6px; height: 2px; border-radius: 1px; background: rgb(0 0 0 / 0.15); }
.dock__art i:nth-child(1) { top: 16px; right: 14px; background: rgb(0 0 0 / 0.35); }
.dock__art i:nth-child(2) { top: 22px; }
.dock__art i:nth-child(3) { top: 27px; right: 12px; }
.dock__badge { position: absolute; right: -3px; bottom: -3px; width: 46%; height: 46%; }
.dock__badge .appicon, .dock__badge img { width: 100%; height: 100%; }
.dock__badge .desk-icon__art { zoom: 0.36; }

/* ——— Spotlight ——— */

.spotlight {
  position: fixed;
  left: 50%;
  top: 22svh;
  z-index: 90;
  width: min(620px, calc(100vw - 32px));
  translate: -50% 0;
  border-radius: 18px;
  background: var(--glass-menu);
  backdrop-filter: blur(40px) saturate(2);
  -webkit-backdrop-filter: blur(40px) saturate(2);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.35), inset 0 0 0 1px var(--glass-edge);
  overflow: hidden;
}
.spotlight__field { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.spotlight__field .glyph { width: 22px; height: 22px; color: var(--ink-3); }
.spotlight__field input {
  flex: 1; min-width: 0;
  border: 0; background: none; outline: none;
  font: 400 22px/1.2 var(--font); color: var(--ink);
}
.spotlight__field input::placeholder { color: rgb(0 0 0 / 0.38); }
.spotlight__results { max-height: 340px; overflow-y: auto; margin: 0; padding: 0 6px 6px; list-style: none; border-top: 1px solid rgb(0 0 0 / 0.08); }
.spotlight__results:empty { display: none; }
.spotlight__group { padding: 8px 10px 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.spotlight__result { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: 8px; font-size: 14px; cursor: default; }
.spotlight__result .appicon, .spotlight__result img, .spotlight__result .desk-icon__art { width: 28px; height: 28px; flex: none; }
/* The drawn folder and page are 64 px; zoom shrinks them, layout and all, wherever they appear small. */
.spotlight__result .desk-icon__art { zoom: 0.44; width: 64px; height: 64px; }
.spotlight__result small { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.spotlight__result[aria-selected="true"] { background: var(--blue-fill); color: #fff; }
.spotlight__result[aria-selected="true"] small { color: rgb(255 255 255 / 0.8); }

/* ——— Notifications, top right like macOS ——— */

.toasts {
  position: fixed;
  top: calc(var(--menubar) + 8px);
  right: 8px;
  z-index: 65; /* under menus and popovers, like macOS notifications */
  display: grid;
  gap: 8px;
  width: min(344px, calc(100vw - 16px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border-radius: 18px;
  background: var(--glass-menu);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-menu), inset 0 0 0 1px var(--glass-edge);
  font-size: 13px;
  animation: toast-in 0.4s var(--ease-out);
}
.toast.is-leaving { animation: toast-out 0.3s ease-in forwards; }
.toast__icon { width: 32px; height: 32px; flex: none; }
.toast__icon img { width: 100%; height: 100%; }
.toast b { display: block; font-size: 13px; }
@keyframes toast-in { from { opacity: 0; translate: 40px 0; } }
@keyframes toast-out { to { opacity: 0; translate: 40px 0; } }

/* ——— Below the desktop: the plain list, for phones, search engines and no JavaScript ——— */

.apps { padding: 80px clamp(16px, 6vw, 96px) 56px; background: var(--surface); font-size: 15px; }
.apps--more { padding-top: 24px; }
.apps__head { max-width: 1200px; margin: 0 auto 32px; }
.apps__head h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; }
.apps__head p { margin: 10px 0 0; max-width: 42em; color: var(--ink-2); }
.app-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.app { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 14px; padding: 18px; border-radius: 18px; background: var(--paper); }
.app__icon { width: 52px; height: 52px; }
.app__name { font-size: 17px; letter-spacing: -0.01em; }
.app__name a { color: inherit; text-decoration: none; }
/* The whole card opens the app's window once JavaScript is here. */
.has-js .app__name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.has-js .app:hover { background: #ececf0; }
.app__tagline { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.app__more { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.app__more p { margin: 0 0 8px; }
.app__more ul { margin: 0 0 8px; padding-left: 1.1em; }
.app__ask { font-size: 12.5px; color: var(--ink-3); }
.app__ask b { color: var(--ink-2); font-weight: 600; }
.has-js .app .app__more { display: none; }
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  max-width: 1200px; margin: 0 auto; padding: 28px clamp(16px, 6vw, 96px) 110px;
  font-size: 13px; color: var(--ink-3);
}
.footer p { margin: 0; }
body > .footer, main > .footer { background: var(--surface); max-width: none; }

/* ——— Phones: a home screen, sheets for windows ——— */

.home {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 8px;
  margin: 0;
  padding: 0 18px;
  list-style: none;
}
.home__app { display: grid; justify-items: center; gap: 5px; padding: 0; border: 0; background: none; color: #fff; font-size: 11.5px; font-weight: 500; text-shadow: 0 1px 2px var(--desk-glow), 0 0 6px var(--desk-glow); }
.home__app .appicon, .home__app img { width: 60px; height: 60px; border-radius: 23%; }
.home__app .desk-icon__art { width: 60px; height: 60px; }

@media (max-width: 760px) {
  :root { --si-pad: 4px; }
  .menubar { padding: 0 4px 0 2px; }
  .menubar__menus a:not(.menubar__mark):not(.menubar__app) { display: none; }
  .si[data-app="upnext"] .si__title, .clock__date, .menubar__system#control-button { display: none; }
  .menubar__clock { margin-left: 2px; }
  .hint, .desk-icons, .dock { display: none !important; }
  .desktop { height: auto; min-height: 100svh; padding: calc(var(--menubar) + 16px) 0 40px; }
  .has-js .home:not([hidden]) { display: grid; }
  /* The Read Me sits in the flow on a phone, a card above the home screen. */
  .window--doc { position: relative !important; left: auto !important; top: auto !important; width: auto !important; max-height: none; margin: 0 12px 24px; }
  .window--doc .window__lights { visibility: hidden; }
  /* A sheet stays at the bottom of the screen; on a wider screen windows belong to the desktop and scroll away with it. */
  .window:not(.window--doc) {
    position: fixed;
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;
    width: 100% !important;
    height: auto !important;
    max-height: 86svh;
    border-radius: 22px 22px 0 0;
  }
  .popover { left: 8px !important; right: 8px; width: auto !important; }
  .menu { max-width: calc(100vw - 16px); }
  .spotlight { top: calc(var(--menubar) + 12px); }
  .apps { padding: 56px 16px 40px; }
  .footer { padding-bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-menu: rgb(242 242 246 / 0.98); --glass-window: rgb(250 250 252 / 0.99); }
  .menubar { background: color-mix(in srgb, var(--sky1), transparent 10%); }
  .dock { background: rgb(240 240 244 / 0.95); }
}
@media (prefers-contrast: more) {
  .menu, .popover, .window, .spotlight { box-shadow: var(--shadow-menu), inset 0 0 0 1px rgb(0 0 0 / 0.5); }
  .desk-icon__name, .home__app { text-shadow: 0 0 3px #000, 0 0 3px #000; }
}
