/* ── The Meaningful desktop (home, after the film opens) ──────────────── */
.desk {
  position: fixed; z-index: 30; top: calc(var(--nav-h, 30px) + var(--safe-t, 0px) + 18px); right: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 420ms cubic-bezier(0.32, 0.72, 0, 1), transform 520ms cubic-bezier(0.34, 1.36, 0.64, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, sans-serif;
}
body.desk-on .desk { opacity: 1; transform: none; pointer-events: auto; }
.dicon { width: 104px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border: 0; background: none; color: #fff; cursor: default; border-radius: 8px; outline: none; -webkit-user-select: none; user-select: none; }
.di-img { width: 68px; height: 68px; display: block; padding: 3px; border-radius: 8px; transition: background-color 120ms, transform 260ms cubic-bezier(0.34, 1.36, 0.64, 1); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)); }
.di-img svg { width: 100%; height: 100%; }
.di-l { max-width: 100%; padding: 1px 6px; border-radius: 4px; font-size: 12.5px; font-weight: 500; line-height: 1.25; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 1px rgba(0, 0, 0, 0.6); }
.dicon.sel .di-img { background: rgba(255, 255, 255, 0.22); }
.dicon.sel .di-l { background: #0a64d6; text-shadow: none; }
.dicon:focus-visible .di-img { box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.8); }
.dicon:active .di-img { transform: scale(0.94); }
body.desk-on .desk .dicon:nth-child(1) { transition-delay: 60ms; }

/* Windows */
.dwin {
  position: fixed; z-index: 60; left: 50%; top: 14vh; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 14px; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, sans-serif;
  background: rgba(30, 30, 33, 0.9); -webkit-backdrop-filter: blur(50px) saturate(180%); backdrop-filter: blur(50px) saturate(180%);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.2), inset 0 0.5px 0 rgba(255, 255, 255, 0.12), 0 30px 90px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0; transform: scale(0.94); transition: opacity 200ms ease, transform 360ms cubic-bezier(0.34, 1.36, 0.64, 1);
}
.dwin.open { opacity: 1; transform: none; }
.dwin:not(.key) { box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.14), 0 18px 50px rgba(0, 0, 0, 0.45); }
.dwin:not(.key) .dw-lights > * { background: rgba(255, 255, 255, 0.18) !important; }
.dwin.dragging { transition: none; }
.dw-bar { position: relative; flex: none; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 14px; cursor: default; touch-action: none; -webkit-user-select: none; user-select: none; border-bottom: 0.5px solid rgba(255, 255, 255, 0.08); }
.dw-lights { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }
.dw-lights > * { width: 12px; height: 12px; border-radius: 50%; padding: 0; border: 0; background: rgba(255, 255, 255, 0.18); }
.dw-lights > :nth-child(2) { background: #febc2e; }
.dw-lights > :nth-child(3) { background: #28c840; }
.dw-close { background: #ff5f57; position: relative; cursor: default; outline: none; }
.dw-lights:hover .dw-close::after { content: "×"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 10px/1 -apple-system, sans-serif; color: rgba(70, 0, 0, 0.8); }
.dw-title { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.9); }
.dw-title svg { width: 16px; height: 16px; }

/* Note (Notes / TextEdit) */
.dwin-note { width: min(560px, calc(100vw - 48px)); height: min(640px, calc(100svh - 120px)); background: rgba(28, 28, 30, 0.94); }
.dwin-note.zoomed { width: min(820px, calc(100vw - 48px)); height: calc(100svh - 80px); }
.note-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 32px 28px; font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, 0.86); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; -webkit-user-select: text; user-select: text; }
.note-date { margin: 0 0 6px; text-align: center; font-size: 12px; color: rgba(235, 235, 245, 0.45); }
.note-body h2 { margin: 6px 0 14px; font-size: 26px; line-height: 1.2; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.note-body h3 { margin: 22px 0 6px; font-size: 17px; font-weight: 700; color: #ffd60a; }
.note-body p { margin: 0 0 10px; }
.note-body b { color: #fff; }
.note-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.note-tags span { padding: 3px 10px; border-radius: 999px; font-size: 13px; background: rgba(255, 255, 255, 0.1); color: #fff; }
.note-btn { display: inline-flex; align-items: center; height: 34px; padding: 0 18px; border-radius: 999px; background: #fff; color: #000; font-weight: 600; font-size: 14px; text-decoration: none; }
.note-btn:active { transform: scale(0.97); }
.note-foot { margin-top: 22px !important; font-size: 12px; color: rgba(235, 235, 245, 0.45); }
.note-foot a { color: rgba(235, 235, 245, 0.7); }

/* Folder (Finder) */
.dwin-folder { width: min(460px, calc(100vw - 48px)); }
.fd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 22px 18px 18px; }
.ffile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 10px; color: #fff; text-decoration: none; cursor: default; outline: none; -webkit-user-select: none; user-select: none; }
.ff-img { width: 72px; height: 72px; border-radius: 17px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 0 0 0.5px rgba(255, 255, 255, 0.15); transition: transform 260ms cubic-bezier(0.34, 1.36, 0.64, 1); }
.ff-img svg { width: 38px; height: 38px; }
.ff-img.ig { background: linear-gradient(45deg, #f9a43a 0%, #ee3d6b 45%, #8a3ab9 100%); }
.ff-img.tt { background: #000; }
.ff-img.em { background: linear-gradient(180deg, #3aa3ff, #0a6cf0); }
.ff-l { padding: 1px 7px; border-radius: 4px; font-size: 12.5px; font-weight: 500; }
.ffile.sel .ff-img { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 6px 16px rgba(0, 0, 0, 0.35); }
.ffile.sel .ff-l { background: #0a64d6; }
.ffile:hover .ff-img { transform: translateY(-2px); }
.ffile:active .ff-img { transform: scale(0.95); }
.ffile:focus-visible .ff-img { box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.8); }
.fd-status { display: flex; justify-content: center; gap: 10px; height: 28px; align-items: center; border-top: 0.5px solid rgba(255, 255, 255, 0.08); font-size: 11.5px; color: rgba(235, 235, 245, 0.55); }
.fd-sel:not(:empty)::before { content: "·"; margin-right: 10px; }

/* the home now ends at the full-bleed film */
.scroll-cue { z-index: 6; }

/* iPhone: icons on the wallpaper, windows become sheets */
@media (max-width: 760px) {
  .desk { top: auto; bottom: calc(28px + var(--safe-b, 0px)); right: 0; left: 0; flex-direction: row; justify-content: center; gap: 28px; }
  .dicon { width: 110px; }
  .di-l { font-size: 13px; }
  .dwin { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100% !important; border-radius: 22px 22px 0 0; transform: translateY(40px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dwin.open { transform: none; }
  .dwin-note { height: calc(100svh - 70px); }
  .dw-bar { height: 50px; }
  .dw-lights > * { width: 14px; height: 14px; }
  .note-body { padding: 14px 20px 24px; font-size: 16px; }
}
@media (prefers-reduced-transparency: reduce) { .dwin { background: #1c1c1e; } }
@media (prefers-reduced-motion: reduce) { .desk, .dwin { transition: opacity 1ms; } }
.dwin[hidden] { display: none !important; }
