/* Tendedero: the site is a small Mac desktop with the app running in it. */

:root {
  --font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --menubar-h: 32px;
  --ink: #1d1d1f;
  --ink-2: rgba(29, 29, 31, 0.62);
  --ink-3: rgba(29, 29, 31, 0.42);
  --accent: #0a84ff;
  --ring: rgba(255, 255, 255, 0.92);
  --bg: #b9b3f6;

  --menubar-bg: rgba(246, 246, 250, 0.42);
  --menubar-ink: #111;
  --glass-bg: rgba(250, 250, 252, 0.62);
  --glass-strong: rgba(250, 250, 252, 0.80);
  --glass-edge-top: rgba(255, 255, 255, 0.85);
  --glass-edge-bottom: rgba(255, 255, 255, 0.18);
  --glass-hairline: rgba(0, 0, 0, 0.10);
  --glass-shadow: 0 1px 1px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(22, 20, 60, 0.16), 0 30px 80px rgba(22, 20, 60, 0.14);
  --menu-hover: #0a84ff;
  --separator: rgba(0, 0, 0, 0.10);

  --card-glass: rgba(247, 247, 249, 0.72);
  --rope: #8c8c8c;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.2, 0.9, 0.22, 1.04);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f5f5f7;
    --ink-2: rgba(245, 245, 247, 0.66);
    --ink-3: rgba(245, 245, 247, 0.42);
    --accent: #0a84ff;
    --ring: rgba(44, 43, 52, 0.95);
    --bg: #1d1a33;
    --menubar-bg: rgba(28, 26, 40, 0.38);
    --menubar-ink: #f5f5f7;
    --glass-bg: rgba(44, 42, 56, 0.55);
    --glass-strong: rgba(40, 38, 52, 0.80);
    --glass-edge-top: rgba(255, 255, 255, 0.30);
    --glass-edge-bottom: rgba(255, 255, 255, 0.05);
    --glass-hairline: rgba(0, 0, 0, 0.45);
    --glass-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 10px 30px rgba(0, 0, 0, 0.35), 0 30px 80px rgba(0, 0, 0, 0.35);
    --separator: rgba(255, 255, 255, 0.12);
    --card-glass: rgba(58, 56, 70, 0.62);
    --rope: #a4a4aa;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #f5f5f7;
  --ink-2: rgba(245, 245, 247, 0.66);
  --ink-3: rgba(245, 245, 247, 0.42);
  --accent: #0a84ff;
  --ring: rgba(44, 43, 52, 0.95);
  --bg: #1d1a33;
  --menubar-bg: rgba(28, 26, 40, 0.38);
  --menubar-ink: #f5f5f7;
  --glass-bg: rgba(44, 42, 56, 0.55);
  --glass-strong: rgba(40, 38, 52, 0.80);
  --glass-edge-top: rgba(255, 255, 255, 0.30);
  --glass-edge-bottom: rgba(255, 255, 255, 0.05);
  --glass-hairline: rgba(0, 0, 0, 0.45);
  --glass-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 10px 30px rgba(0, 0, 0, 0.35), 0 30px 80px rgba(0, 0, 0, 0.35);
  --separator: rgba(255, 255, 255, 0.12);
  --card-glass: rgba(58, 56, 70, 0.62);
  --rope: #a4a4aa;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: default;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Glass ---------- */

/* Crisp glass, as in the app: a blurred material with a thin specular edge
   lit from above, and a dark hairline so it reads on any background. */
.glass-panel,
.glass-capsule,
.glass-menu,
.glass-card {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  box-shadow: var(--glass-shadow), 0 0 0 0.5px var(--glass-hairline);
}
.glass-panel::after,
.glass-capsule::after,
.glass-menu::after,
.glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 0.75px;
  background: linear-gradient(to bottom, var(--glass-edge-top), var(--glass-edge-bottom));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.glass-capsule { border-radius: 999px; }

/* ---------- Desktop ---------- */

#desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#scene .win { cursor: default; }
#scene .titlebar { cursor: default; }
#scene .drop-glow { opacity: 0; transition: opacity 0.18s; }
#scene .win.drop-target .drop-glow { opacity: 1; }
#scene .folder { transition: transform 0.25s var(--ease-spring); transform-box: fill-box; transform-origin: center; }
#scene .folder.drop-target { transform: scale(1.08); }
#scene .folder.drop-target .folder-sel { opacity: 1; }
#scene .folder-sel { opacity: 0; transition: opacity 0.15s; }

#scene-hits { position: absolute; inset: 0; pointer-events: none; }
#scene-hits a, #scene-hits button {
  position: absolute;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  border-radius: 999px;
  cursor: pointer;
}

#desktop-files { position: absolute; inset: 0; pointer-events: none; }
.desktop-file {
  position: absolute;
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
  animation: file-in 0.35s var(--ease-spring);
}
.desktop-file img {
  max-width: 64px;
  max-height: 52px;
  border-radius: 3px;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.18);
  background: #fff;
}
.desktop-file span {
  font-size: 11.5px;
  line-height: 1.25;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  padding: 1px 4px;
  border-radius: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desktop-file.selected span { background: var(--accent); text-shadow: none; }
@keyframes file-in { from { transform: scale(0.6); opacity: 0; } }

/* ---------- Menu bar ---------- */

#menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--menubar-h);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  color: var(--menubar-ink);
  background: var(--menubar-bg);
  -webkit-backdrop-filter: blur(30px) saturate(1.9);
  backdrop-filter: blur(30px) saturate(1.9);
  box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.08);
  font-size: 13.5px;
  letter-spacing: -0.01em;
}
.mb-left, .mb-right { display: flex; align-items: center; height: 100%; gap: 2px; }
.mb-item {
  height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 6px;
  white-space: nowrap;
}
button.mb-item:hover, .mb-item.open { background: rgba(128, 128, 140, 0.2); }
.mb-app { font-weight: 700; }
.mb-icon { padding: 0 7px; }
.mb-icon svg, .mb-glyph { width: 17px; height: 17px; }
.tshirt { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.tshirt.filled { fill: currentColor; }
.mb-glyph { fill: currentColor; }
.mb-static { opacity: 0.92; }
.mb-battery i {
  position: relative;
  width: 24px;
  height: 11.5px;
  border: 1.2px solid currentColor;
  border-radius: 3.5px;
  opacity: 0.85;
  display: block;
}
.mb-battery i::before {
  content: "";
  position: absolute;
  left: 1.5px; top: 1.5px; bottom: 1.5px;
  width: 72%;
  background: currentColor;
  border-radius: 1.5px;
}
.mb-battery i::after {
  content: "";
  position: absolute;
  right: -3.5px; top: 3px;
  width: 1.6px; height: 3.5px;
  background: currentColor;
  border-radius: 0 1px 1px 0;
}
#clock { font-variant-numeric: tabular-nums; }

/* The hint that the menu bar is where the line lives. */
#menubar.beckon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 220px;
  height: 24px;
  margin-left: -110px;
  border-radius: 12px;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85), 0 0 18px rgba(255, 255, 255, 0.7);
  animation: beckon 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes beckon {
  0%, 100% { opacity: 0; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1); }
}

/* ---------- The line ---------- */

#line {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--menubar-h);
  height: var(--line-h, 210px);
  z-index: 30;
  pointer-events: none;
}
#line-strip {
  position: absolute;
  inset: 0;
  transform: translateY(calc(-1 * (var(--line-h, 210px) + 12px)));
  will-change: transform;
}
#rope {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 60px;
  overflow: visible;
  -webkit-mask: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
#line-hint {
  position: absolute;
  left: 50%;
  top: 46px;
  transform: translateX(-50%);
  font-family: var(--font-rounded);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 6px 12px;
  white-space: nowrap;
  transition: opacity 0.3s;
}
#line-hint.gone { opacity: 0; }
#pegs { position: absolute; inset: 0; }

.peg {
  position: absolute;
  top: 0;
  width: var(--card-w, 150px);
  margin-left: calc(var(--card-w, 150px) / -2);
  transition: left 0.55s var(--ease-spring), top 0.55s var(--ease-spring), opacity 0.25s;
  pointer-events: none;
}
.peg.instant { transition: none; }
.swing {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 0;
  will-change: transform;
}
.clip {
  position: relative;
  z-index: 2;
  width: 9px;
  height: 26px;
  border-radius: 3.5px;
  background: linear-gradient(to right, #b3b3b3 0%, #ededed 35%, #d1d1d1 65%, #9e9e9e 100%);
  box-shadow: inset 0 0 0 0.6px rgba(255, 255, 255, 0.75), 0 1.5px 2px rgba(0, 0, 0, 0.30);
}
.clip::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 8.5px;
  width: 5px;
  height: 1.4px;
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.32);
}
.card {
  position: relative;
  margin-top: -12px;
  padding: 4px;
  border-radius: 16px;
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: 0 0 0 0.5px var(--glass-hairline), 0 5px 10px rgba(0, 0, 0, 0.10), 0 5px 20px rgba(0, 0, 0, 0.08);
  transform-origin: 50% 0;
  transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.18s ease-out, opacity 0.2s;
  pointer-events: auto;
  touch-action: none;
  cursor: default;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 0.75px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
.card img {
  display: block;
  border-radius: 12px;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.18);
  -webkit-user-drag: none;
  pointer-events: none;
}
.card .photo-edge {
  position: absolute;
  inset: 4px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.18), inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  pointer-events: none;
}
.card:focus { outline: none; }
.card:focus-visible { box-shadow: 0 0 0 0.5px var(--glass-hairline), 0 0 0 3px var(--accent), 0 5px 20px rgba(0, 0, 0, 0.08); }
.peg.hover .card {
  transform: scale(1.035);
  box-shadow: 0 0 0 0.5px var(--glass-hairline), 0 8px 14px rgba(0, 0, 0, 0.14), 0 8px 28px rgba(0, 0, 0, 0.12);
}
.peg.pressed .card {
  transform: scale(0.95);
  transition: transform 0.45s ease-in-out, box-shadow 0.18s;
}
.peg.dragging .card { opacity: 0.45; }
.peg.flying { opacity: 0; }

.cross {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  pointer-events: none;
}
.cross svg { width: 8px; height: 8px; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; fill: none; }
.peg.hover:not(.dragging) .cross { opacity: 1; transform: scale(1); }
.cross:hover { background: var(--glass-strong); }

.copied {
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translate(-50%, 4px);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  pointer-events: none;
}
.copied svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.peg.copied-on .copied { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Flights, drags, falls ---------- */

#flight-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}
.flyer {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 50% 0;
  will-change: transform, width, height;
}
.flyer .glass {
  position: absolute;
  inset: 0;
  background: var(--card-glass);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.24);
}
.flyer .edge {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.flyer img {
  position: absolute;
  object-fit: cover;
  display: block;
}
.flyer .clip { position: absolute; left: 50%; margin-left: -4.5px; top: -14px; }

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  padding: 4px;
  border-radius: 16px;
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: 0 0 0 0.5px var(--glass-hairline), 0 18px 40px rgba(0, 0, 0, 0.28);
  transform-origin: 50% 30%;
  will-change: transform;
}
.ghost img { display: block; border-radius: 12px; }
.ghost .badge {
  position: absolute;
  right: -8px;
  top: -8px;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #30c759;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s, transform 0.2s var(--ease-spring);
}
.ghost.copy .badge { opacity: 1; transform: scale(1); }

/* ---------- Capture ---------- */

#toolbar {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 18px;
  transition: opacity 0.25s, transform 0.35s var(--ease-out);
}
#toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 11px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink);
  transition: background 0.15s;
}
#toolbar button:hover { background: rgba(128, 128, 140, 0.16); }
#toolbar button.primary { background: var(--accent); color: #fff; }
#toolbar button.primary:hover { background: #2a94ff; }
#toolbar svg { width: 24px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#toolbar svg circle { fill: currentColor; stroke: none; }
body.capturing #toolbar { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }

#capture-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  cursor: crosshair;
  touch-action: none;
}
#capture-layer.window-mode { cursor: default; }
#capture-shade { position: absolute; inset: 0; }
/* Choosing Selection dims the whole screen a little; the area being dragged
   out is cut clear of the dimming, so it shows what will be captured. */
#capture-layer.selection-mode #capture-shade {
  background: rgba(10, 10, 20, 0.26);
  animation: fade-in 0.22s ease-out;
}
#capture-layer.selection-mode.dragging #capture-shade { background: none; }
#capture-rect {
  position: absolute;
  display: none;
  background: rgba(130, 130, 140, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35);
}
#capture-layer.selection-mode #capture-rect {
  background: none;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35), 0 0 0 200vmax rgba(10, 10, 20, 0.26);
}
#capture-rect.win-mode {
  background: rgba(64, 140, 255, 0.24);
  border: 0;
  box-shadow: none;
  border-radius: 14px;
}
#capture-size {
  position: absolute;
  right: -6px;
  bottom: -26px;
  transform: translateX(100%);
  font: 500 11px var(--font-mono);
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
#capture-rect.win-mode #capture-size { display: none; }
#capture-hint {
  position: absolute;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 5px 5px 16px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
}
/* A way out without a keyboard: Esc is not on a phone. */
#capture-cancel {
  pointer-events: auto;
  height: 28px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(128, 128, 140, 0.18);
}
#capture-cancel:hover { background: rgba(128, 128, 140, 0.28); }
@media (max-width: 760px) {
  #capture-hint { bottom: calc(118px + env(safe-area-inset-bottom)); white-space: normal; width: max-content; max-width: calc(100vw - 32px); }
}
#flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
#flash.on { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#credit {
  position: fixed;
  left: 18px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 20;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  display: flex;
  gap: 6px;
}
#credit a { text-decoration: none; }
#credit a:hover { text-decoration: underline; }
#langs {
  position: fixed;
  right: 18px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ink-2);
}
#langs a { color: inherit; text-decoration: none; opacity: 0.8; }
#langs a:hover { opacity: 1; text-decoration: underline; }
#langs .current { font-weight: 600; }
@media (max-width: 980px) { #credit, #langs { display: none; } }

/* ---------- Dock ---------- */

#dock {
  position: fixed;
  left: 50%;
  bottom: calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 24px;
}
.dock-app {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  transition: transform 0.25s var(--ease-spring);
}
.dock-app:hover { transform: translateY(-4px) scale(1.06); }
.dock-app.bounce { animation: bounce 0.9s var(--ease-out); }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-18px); }
  55% { transform: translateY(0); }
  72% { transform: translateY(-7px); }
}
.dock-app svg, .dock-app img { width: 100%; height: 100%; display: block; }
.dock-app .dot {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.55;
}
.dock-app .label {
  position: absolute;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.dock-app:hover .label { opacity: 1; }
.dock-app[data-app="keepers"], .dock-app[data-app="video"] { display: none; }
@media (max-width: 759.98px) { .dock-app[data-app="keepers"], .dock-app[data-app="video"] { display: block; } }
/* Six apps on a narrow phone: a little smaller, still easy to tap. */
@media (max-width: 420px) {
  .dock-app { width: 40px; height: 40px; border-radius: 10px; }
  #dock { gap: 3px; padding: 5px 6px; }
}
/* A touch has no hover, so a name would stay up after the tap. */
@media (hover: none) { .dock-app .label { display: none; } }
#scene-hits .folder-hit { cursor: default; }
.dock-sep { width: 1px; align-self: stretch; margin: 6px 3px; background: var(--separator); }
.dock-app.drop-target { transform: translateY(-6px) scale(1.12); }
.dock-app.gulp { animation: gulp 0.42s var(--ease-out); }
@keyframes gulp {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.12) translateY(-3px); }
  65% { transform: scale(0.97); }
}

/* ---------- Menus ---------- */

#menus { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.glass-menu {
  position: absolute;
  min-width: 220px;
  padding: 5px;
  border-radius: 12px;
  background: var(--glass-strong);
  font-size: 13.5px;
  pointer-events: auto;
  animation: menu-in 0.12s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-2px); } }
.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 24px;
  padding: 0 10px 0 24px;
  border-radius: 6px;
  text-align: left;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}
.menu-item:hover:not([aria-disabled="true"]), .menu-item.open {
  background: var(--menu-hover);
  color: #fff;
}
.menu-item[aria-disabled="true"] { color: var(--ink-3); }
.menu-item .check { position: absolute; left: 8px; font-size: 12px; }
.menu-item .key { margin-left: auto; padding-left: 24px; color: var(--ink-3); font-size: 13px; letter-spacing: 0.04em; }
.menu-item:hover .key { color: rgba(255, 255, 255, 0.8); }
.menu-item .chev { margin-left: auto; padding-left: 24px; font-size: 11px; opacity: 0.7; }
.menu-sep { height: 1px; margin: 5px 10px; background: var(--separator); }
.menu-title { padding: 4px 10px 4px 24px; font-size: 12px; font-weight: 600; color: var(--ink-3); }

/* ---------- Modals: Quick Look, Markup, About ---------- */

#modals { position: fixed; inset: 0; z-index: 85; pointer-events: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  background: rgba(10, 8, 30, 0.12);
  animation: fade-in 0.2s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }
.window {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 20px;
  overflow: hidden;
  pointer-events: auto;
  background: var(--glass-strong);
  animation: window-in 0.32s var(--ease-spring);
}
@keyframes window-in { from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); } }
.window-bar {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 16px;
  font-size: 13px;
  font-weight: 600;
}
.window-bar .title { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lights { display: flex; gap: 8px; }
.lights button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}
.lights .close { background: #ff5f57; }
.lights .min { background: #febc2e; }
.lights .zoom { background: #28c840; }
.bar-btn {
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  background: rgba(128, 128, 140, 0.16);
}
.bar-btn:hover { background: rgba(128, 128, 140, 0.26); }
.bar-btn.primary { background: var(--accent); color: #fff; }
.bar-btn.primary:hover { background: #2a94ff; }
.bar-btn svg { width: 14px; height: 14px; vertical-align: -2px; }

.ql-body { position: relative; padding: 0 14px 14px; display: grid; place-items: center; }
.ql-body img { display: block; border-radius: 10px; box-shadow: 0 0 0 0.5px var(--separator); }
.ql-nav { font-size: 12px; color: var(--ink-3); font-weight: 500; }

.mk-tools { display: flex; align-items: center; gap: 6px; }
.mk-color {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.mk-color.on { box-shadow: 0 0 0 2px var(--glass-strong), 0 0 0 3.5px var(--accent); }
.mk-color:hover { transform: scale(1.1); }
.mk-sep { width: 1px; height: 20px; background: var(--separator); margin: 0 4px; }
.mk-canvas-wrap { padding: 0 14px 14px; display: grid; place-items: center; }
.mk-canvas-wrap canvas { display: block; border-radius: 10px; cursor: crosshair; touch-action: none; box-shadow: 0 0 0 0.5px var(--separator); }

/* The Trash and Keepers, as small Finder windows. */
.folder-window { width: min(560px, calc(100vw - 32px)); }
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 6px;
  min-height: 190px;
  max-height: min(380px, 56vh);
  overflow-y: auto;
  padding: 6px 14px 8px;
  align-content: start;
}
.folder-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 176px;
  font-size: 13px;
  color: var(--ink-3);
}
.folder-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 10px;
}
.folder-file .thumb { width: 92px; height: 66px; display: grid; place-items: center; border-radius: 6px; }
.folder-file img { max-width: 100%; max-height: 100%; border-radius: 4px; box-shadow: 0 0 0 0.5px var(--separator), 0 2px 6px rgba(0, 0, 0, 0.12); }
.folder-file .name { max-width: 100%; font-size: 11.5px; line-height: 1.3; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 5px; border-radius: 4px; }
.folder-file.selected .thumb { background: rgba(128, 128, 140, 0.18); }
.folder-file.selected .name { background: var(--accent); color: #fff; }
.folder-foot { padding: 7px 14px 9px; border-top: 0.5px solid var(--separator); font-size: 11.5px; color: var(--ink-3); text-align: center; }
.bar-btn:disabled { opacity: 0.4; pointer-events: none; }

/* The film, in a window like QuickTime's. */
.video-window { width: min(960px, calc(100vw - 32px)); }
.vp-stage { position: relative; margin: 0 10px 10px; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.vp-stage video { width: 100%; height: 100%; display: block; object-fit: cover; cursor: pointer; }
.vp-stage.idle:not(.paused) { cursor: none; }
.vp-stage.idle:not(.paused) video { cursor: none; }
.vp-bar {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px 7px 8px;
  border-radius: 14px;
  color: #fff;
  background: rgba(28, 28, 34, 0.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.22), 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: opacity 0.35s, transform 0.35s var(--ease-out);
}
.vp-stage.idle:not(.paused) .vp-bar { opacity: 0; transform: translate(-50%, 6px); pointer-events: none; }
.vp-toggle { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #fff; flex: none; }
.vp-toggle:hover { background: rgba(255, 255, 255, 0.14); }
.vp-toggle svg { width: 15px; height: 15px; fill: currentColor; }
.vp-track { position: relative; flex: 1; height: 16px; cursor: pointer; touch-action: none; }
.vp-track::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.28); }
.vp-fill { position: absolute; left: 0; top: 6px; height: 4px; border-radius: 2px; background: #fff; }
.vp-time { font: 500 11.5px var(--font); font-variant-numeric: tabular-nums; opacity: 0.85; min-width: 34px; text-align: right; }

/* The window the app's Check for Updates opens. */
.update { width: min(420px, calc(100vw - 32px)); text-align: center; padding-bottom: 24px; }
.update-body { padding: 0 30px; }
.update-body.swap > * { animation: update-in 0.5s var(--ease-out) both; }
.update-body.swap > :nth-child(2) { animation-delay: 0.04s; }
.update-body.swap > :nth-child(3) { animation-delay: 0.08s; }
.update-body.swap > :nth-child(4) { animation-delay: 0.12s; }
.update-body.swap > :nth-child(n + 5) { animation-delay: 0.16s; }
@keyframes update-in { from { opacity: 0; transform: translateY(6px); } }
.update-icon { position: relative; width: 104px; height: 104px; margin: 0 auto 14px; }
.update-icon img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 18px rgba(30, 20, 80, 0.24)); }
.update-icon.checking img { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(0.96); opacity: 0.85; } }
.update-icon .badge {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 3px var(--ring), 0 6px 14px rgba(0, 0, 0, 0.2);
  animation: badge-pop 0.55s var(--ease-spring) 0.18s both;
}
@keyframes badge-pop { from { transform: scale(0.3); opacity: 0; } }
.update-icon.ok .badge { background: linear-gradient(#45dd70, #25b14b); }
.update-icon.new .badge { background: linear-gradient(#3a9bff, #0a74f0); }
.update-icon.warn .badge { background: linear-gradient(#ffb340, #ff8a00); }
.update-icon .badge svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.update-icon .badge circle { fill: #fff; }
.update h2 { margin: 0; font: 700 22px/1.2 var(--font-display); letter-spacing: -0.02em; }
.update .lede { margin: 7px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.update-spinner {
  width: 18px;
  height: 18px;
  margin: 16px auto 6px;
  border-radius: 50%;
  border: 2px solid rgba(128, 128, 140, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.update-card { margin-top: 18px; padding: 12px 14px 12px; border-radius: 14px; text-align: left; background: rgba(128, 128, 140, 0.1); box-shadow: inset 0 0 0 0.5px var(--separator); }
.update-card-title { display: flex; align-items: baseline; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.update-card-title span { font-weight: 400; letter-spacing: 0; text-transform: none; }
.update-notes { list-style: none; margin: 9px 0 0; padding: 0; display: grid; gap: 7px; font-size: 12.5px; line-height: 1.42; color: var(--ink-2); }
.update-notes li { position: relative; padding-left: 14px; }
.update-notes li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0.85; }
.update-notes li.more::before { display: none; }
.update-notes b { color: var(--ink); font-weight: 600; }
.update-notes code, .brew-chip code { font: 500 11px var(--font-mono); }
.update-notes code { padding: 1px 4px; border-radius: 4px; background: rgba(128, 128, 140, 0.16); }
.update-notes a { color: var(--accent); text-decoration: none; }
.update-actions { display: flex; justify-content: center; margin-top: 20px; }
a.bar-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.bar-btn.wide { min-width: 210px; }
.bar-btn.big { height: 42px; padding: 0 24px; gap: 8px; border-radius: 13px; font-size: 14px; font-weight: 600; box-shadow: 0 8px 20px rgba(10, 132, 255, 0.34); }
.bar-btn.big:active { transform: scale(0.98); }
.dl-arrow svg { width: 16px; height: 16px; display: block; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.update-steps { margin: 12px 6px 0; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
.update-brew { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 11.5px; color: var(--ink-3); }
.brew-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px 5px 10px; border-radius: 8px; color: var(--ink-2); background: rgba(128, 128, 140, 0.12); box-shadow: inset 0 0 0 0.5px var(--separator); }
.brew-chip:hover { background: rgba(128, 128, 140, 0.2); }
.copy-glyph svg { width: 11px; height: 12px; display: block; fill: none; stroke: var(--ink-3); stroke-width: 1.3; }
.update-link { display: inline-block; margin-top: 14px; padding: 0; font-size: 12.5px; color: var(--accent); text-decoration: none; background: none; }
.update-link:hover { text-decoration: underline; }

.about { width: 340px; text-align: center; padding-bottom: 26px; }
.about img { width: 112px; height: 112px; margin: 4px auto 10px; display: block; filter: drop-shadow(0 8px 16px rgba(30, 20, 80, 0.22)); }
.about h2 { margin: 0; font: 700 22px var(--font-display); letter-spacing: -0.02em; }
.about .ver { margin: 4px 0 16px; font-size: 12.5px; color: var(--ink-2); }
.about p { margin: 6px 26px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.about .links { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }

/* ---------- Coach marks and toast ---------- */

#coach { position: fixed; inset: 0; z-index: 75; pointer-events: none; }
.coach {
  position: absolute;
  max-width: 300px;
  padding: 11px 15px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
  animation: coach-in 0.5s var(--ease-spring);
  pointer-events: auto;
}
.coach b { font-weight: 650; }
.coach .step { display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.coach .skip {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  color: var(--ink-3);
}
.coach .skip:hover { background: rgba(128, 128, 140, 0.18); }
.coach::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 2px;
}
.coach.up::before { left: calc(50% - 6px); top: -5px; }
.coach.down::before { left: calc(50% - 6px); bottom: -5px; }
.coach.left::before { left: -5px; top: calc(50% - 6px); }
@keyframes coach-in { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
.coach.out { animation: coach-out 0.25s ease-in forwards; }
@keyframes coach-out { to { opacity: 0; transform: scale(0.97); } }

#toast {
  position: fixed;
  left: 50%;
  top: calc(var(--menubar-h) + 14px);
  z-index: 95;
  transform: translate(-50%, -10px);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.3s var(--ease-spring);
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

.noscript { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; background: var(--bg); }

/* ---------- Small screens and touch ---------- */

@media (max-width: 760px) {
  #menubar.beckon::after { width: 96px; margin-left: -48px; left: 50%; }
  .mb-left .mb-item:not(.mb-app) { display: none; }
  .mb-static:not(#clock) { display: none; }
  #toolbar { bottom: calc(86px + env(safe-area-inset-bottom)); }
  #toolbar button { padding: 0 10px; }
  #toolbar button span { display: none; }
  #toolbar button.primary span { display: inline; }
  .dock-app { width: 46px; height: 46px; border-radius: 11px; }
  #dock { gap: 4px; padding: 6px; border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
