:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mb: 25px;
  --sel: #0a63d8;
  --win: #ffffff;
  --side: rgba(236, 236, 240, .82);
  --line: #e2e2e6;
  --text: #1d1d1f;
  --muted: #86868b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 13px; color: var(--text); background: #000; overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
a { color: inherit; }
img { display: block; }
:focus-visible { outline: 3px solid rgba(10, 99, 216, .5); outline-offset: 1px; border-radius: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- BOOT ---------- */
.boot { position: fixed; inset: 0; z-index: 9999; background: #000; display: grid; place-content: center; justify-items: center; gap: 46px; transition: opacity .6s, visibility .6s; }
.boot.done { opacity: 0; visibility: hidden; }
.boot-logo { color: #fff; font-weight: 700; font-size: 54px; letter-spacing: -.04em; }
.boot-bar { width: 160px; height: 5px; border-radius: 3px; background: #3a3a3c; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: #fff; animation: boot 1.6s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes boot { 30% { width: 22%; } 60% { width: 58%; } 100% { width: 100%; } }

/* ---------- WALLPAPERS ---------- */
.desktop {
  position: fixed; inset: 0; padding-top: var(--mb);
  background: #0d0d10;
  transition: background .6s;
}
/* comic wallpaper: softened so windows and icons stand out —
   a little blur, less color, darker, and a vignette toward the edges */
.desktop:not([data-wall])::before,
.desktop[data-wall="1"]::before {
  content: ""; position: absolute; inset: -16px; height: auto; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%),
    linear-gradient(rgba(12,12,18,.28), rgba(12,12,18,.42)),
    url("wallpaper.jpg") center / cover no-repeat;
  filter: blur(2.5px) saturate(.75) brightness(.78);
}
.desktop[data-wall="4"] {
  background-color: #1b2a4a;
  background-image:
    radial-gradient(120% 80% at 85% 110%, #f39c5a 0%, rgba(243, 156, 90, 0) 55%),
    radial-gradient(90% 70% at 10% 100%, #c2427a 0%, rgba(194, 66, 122, 0) 60%),
    radial-gradient(110% 90% at 50% 0%, #3b5fb5 0%, rgba(59, 95, 181, 0) 65%),
    linear-gradient(180deg, #23366b 0%, #4a3f8a 55%, #9b4f86 100%);
}
.desktop[data-wall="2"] {
  background-color: #0c3b3a;
  background-image:
    radial-gradient(80% 60% at 20% 20%, #4fb3a9, rgba(79,179,169,0) 60%),
    radial-gradient(90% 70% at 90% 90%, #e9c46a, rgba(233,196,106,0) 60%),
    linear-gradient(160deg, #0f4c5c, #2a6f62 60%, #c9a35a);
}
.desktop[data-wall="3"] {
  background-color: #111;
  background-image:
    radial-gradient(70% 60% at 70% 30%, #3a3a3e, rgba(58,58,62,0) 70%),
    linear-gradient(180deg, #1c1c1e, #0b0b0c);
}
.desktop::before { /* soft hills */
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -20%; height: 60%; pointer-events: none;
  background: radial-gradient(60% 55% at 30% 100%, rgba(255,255,255,.10), rgba(255,255,255,0) 70%),
              radial-gradient(55% 45% at 78% 100%, rgba(0,0,0,.18), rgba(0,0,0,0) 70%);
}

/* ---------- MENU BAR ---------- */
.menubar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--mb); z-index: 5000; color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
  background: rgba(20, 22, 40, .28); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  text-shadow: 0 0 1px rgba(0,0,0,.2);
}
.mb-left, .mb-right { display: flex; align-items: center; height: 100%; }
.mb-btn, .mb-app { height: 21px; padding: 0 9px; border-radius: 4px; display: inline-flex; align-items: center; font-size: 13px; }
.mb-app { font-weight: 700; padding: 0 9px; }
.mb-logo { padding: 0 11px; }
.mb-btn[aria-expanded="true"] { background: rgba(255,255,255,.25); }
.mb-right { gap: 2px; }
.mb-ico { display: inline-flex; padding: 0 7px; opacity: .95; }
.mb-clock { padding: 0 8px; font-size: 13px; font-variant-numeric: tabular-nums; }

.menu {
  position: absolute; top: calc(var(--mb) + 1px); min-width: 230px; padding: 5px; color: var(--text); text-shadow: none;
  background: rgba(246, 246, 248, .78); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: .5px solid rgba(0,0,0,.18); border-radius: 8px; box-shadow: 0 10px 34px rgba(0,0,0,.25), inset 0 0 0 .5px rgba(255,255,255,.6);
}
.menu button { display: flex; width: 100%; justify-content: space-between; gap: 20px; padding: 3px 10px; border-radius: 4px; font-size: 13px; text-align: left; }
.menu button:not(:disabled):hover, .menu button:focus-visible { background: var(--sel); color: #fff; outline: none; }
.menu button:disabled { color: #b0b0b5; }
.menu kbd { font: inherit; color: #8a8a8e; }
.menu button:hover kbd { color: rgba(255,255,255,.85); }
.menu hr { border: 0; border-top: 1px solid rgba(0,0,0,.1); margin: 5px 10px; }

/* ---------- DESKTOP ICONS ---------- */
.icons { position: absolute; inset: var(--mb) 0 0 0; }
.icon { position: absolute; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 4px; touch-action: none; }
.gl { width: 66px; height: 60px; display: grid; place-items: center; border-radius: 5px; border: 2px solid transparent; }
.gl svg { width: 60px; height: 50px; filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.25)); }
.gl svg.doc { width: 44px; height: 54px; }
.gl-app { width: 62px; height: 62px; -webkit-user-drag: none; }
.thumb { width: 46px; height: 56px; padding: 2px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.lbl { max-width: 96px; padding: 1px 5px; border-radius: 4px; font-size: 12px; font-weight: 500; line-height: 1.25; text-align: center; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.65); word-break: break-word; }
.icon.sel .gl { background: rgba(0,0,0,.22); border-color: rgba(255,255,255,.28); }
.icon.sel .lbl { background: var(--sel); text-shadow: none; }
.icon.drag { opacity: .7; z-index: 3; }
.lasso { position: absolute; z-index: 2; border: 1px solid rgba(255,255,255,.7); background: rgba(255,255,255,.15); pointer-events: none; }

/* ---------- WINDOWS ---------- */
.windows { position: absolute; inset: var(--mb) 0 0 0; pointer-events: none; z-index: 4; }
.win {
  position: absolute; pointer-events: auto; display: flex; flex-direction: column; overflow: hidden;
  background: var(--win); border-radius: 11px;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.28), 0 22px 70px rgba(0,0,0,.42), 0 6px 18px rgba(0,0,0,.18);
  animation: open .22s cubic-bezier(.2, .8, .3, 1);
  user-select: text; -webkit-user-select: text;
}
.win[hidden] { display: none !important; }
.win.inactive { box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 12px 36px rgba(0,0,0,.28); }
.win.zoomed { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - 78px) !important; border-radius: 0; }
.win.out { animation: close .16s ease-in forwards; }
.win.mini { animation: mini .38s cubic-bezier(.6, 0, .9, .5) forwards; }
@keyframes open { from { opacity: 0; transform: scale(.94); } }
@keyframes close { to { opacity: 0; transform: scale(.96); } }
@keyframes mini { to { opacity: 0; transform: translateY(80vh) scale(.08); } }

.bar { position: relative; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; background: #f6f6f6; border-bottom: 1px solid #e3e3e3; user-select: none; -webkit-user-select: none; touch-action: none; }
.title { font-size: 13px; font-weight: 600; color: #4b4b4f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.win.inactive .title { color: #a8a8ad; }
.lights { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; z-index: 2; }
.lights button { width: 12px; height: 12px; border-radius: 50%; position: relative; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.18); }
.l-close { background: #ff5f57; } .l-min { background: #febc2e; } .l-max { background: #28c840; }
.win.inactive .lights button { background: #dcdcdc; }
.lights:hover button { background-repeat: no-repeat; background-position: center; }
.lights:hover .l-close { background-color: #ff5f57; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.6 3.6l4.8 4.8M8.4 3.6L3.6 8.4' stroke='%234d0000' stroke-width='1.2'/%3E%3C/svg%3E"); }
.lights:hover .l-min { background-color: #febc2e; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6h6' stroke='%23985700' stroke-width='1.3'/%3E%3C/svg%3E"); }
.lights:hover .l-max { background-color: #28c840; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.5 7V3.5H7zM8.5 5v3.5H5z' fill='%23006500'/%3E%3C/svg%3E"); }
.body { flex: 1; min-height: 0; overflow: auto; }

/* ---------- FINDER ---------- */
.finder { display: grid; grid-template-columns: 170px 1fr; height: 100%; }
.f-win .bar { height: 52px; background: #fff; justify-content: flex-start; padding-left: 186px; gap: 10px; border-bottom: 1px solid #e6e6e6; }
.f-win .lights { top: 18px; transform: none; }
.f-win .title { max-width: none; font-size: 14px; font-weight: 700; color: #1d1d1f; }
.f-nav { display: flex; gap: 2px; }
.f-nav button { width: 28px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: #6e6e73; }
.f-nav button:hover:not(:disabled) { background: #ececee; }
.f-nav button:disabled { color: #c7c7cc; }
.f-tools { margin-left: auto; margin-right: 12px; display: flex; align-items: center; gap: 8px; }
.f-search { width: 150px; height: 26px; border-radius: 7px; border: 0; background: #ececef; padding: 0 10px 0 26px; font: inherit; font-size: 12.5px; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.5' cy='6.5' r='4.5' fill='none' stroke='%238a8a8e' stroke-width='1.6'/%3E%3Cpath d='M10 10l4 4' stroke='%238a8a8e' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 13px; background-position: 8px 50%; }
.f-search:focus { box-shadow: 0 0 0 3px rgba(10,99,216,.35); background-color: #fff; }
.f-side { position: absolute; left: 0; top: 0; bottom: 0; width: 170px; padding: 58px 10px 10px; background: var(--side); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border-right: 1px solid #e0e0e4; z-index: 1; overflow: auto; }
.f-win .body { margin-left: 170px; }
.f-win { --pad: 0; }
.f-side h4 { margin: 10px 8px 4px; font-size: 11px; font-weight: 600; color: #a0a0a6; }
.f-side button { display: flex; align-items: center; gap: 7px; width: 100%; padding: 4px 8px; border-radius: 6px; font-size: 13px; text-align: left; }
.f-side button svg { width: 16px; height: 16px; color: var(--sel); flex: none; }
.f-side button.on { background: rgba(0,0,0,.08); }
.f-side .tag i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin: 0 3px; }
.f-win .body { display: flex; flex-direction: column; }
.f-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px 4px; padding: 16px 14px; align-content: start; }
.f-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 2px; }
.f-item .gl { width: 70px; height: 62px; }
.f-item .lbl { color: var(--text); text-shadow: none; font-weight: 400; }
.f-item.sel .gl { background: rgba(0,0,0,.08); border-color: transparent; }
.f-item.sel .lbl { background: var(--sel); color: #fff; }
.f-empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.f-status { position: sticky; bottom: 0; padding: 5px 14px; font-size: 11.5px; color: var(--muted); background: rgba(255,255,255,.92); border-top: 1px solid #efefef; text-align: center; }

/* project page inside finder (gallery/preview) */
.proj { padding: 26px 30px 34px; max-width: 640px; user-select: text; -webkit-user-select: text; }
.proj-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.proj-head .gl { width: 74px; height: 64px; flex: none; }
.proj h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.proj .kind { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.proj p { font-size: 13.5px; line-height: 1.6; margin: 0 0 12px; color: #333336; }
.proj ul { margin: 0 0 14px; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: #333336; }
.proj h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.info { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; font-size: 12.5px; padding: 12px 0; border-top: 1px solid #ededf0; border-bottom: 1px solid #ededf0; margin: 16px 0; }
.info dt { color: var(--muted); text-align: right; }
.info dd { margin: 0; }
.info dd a { color: var(--sel); text-decoration: none; }
.info dd a:hover { text-decoration: underline; }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.nums div { padding: 12px; border: 1px solid #ececf0; border-radius: 9px; background: #fafafb; }
.nums b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.nums span { font-size: 11.5px; color: var(--muted); line-height: 1.35; display: block; margin-top: 2px; }
.mac-btn { display: inline-block; padding: 4px 14px; border-radius: 6px; background: var(--sel); color: #fff; text-decoration: none; font-size: 13px; box-shadow: 0 1px 1px rgba(0,0,0,.15); }
.mac-btn:hover { background: #0857c0; }
.mac-btn.light { background: #fff; color: var(--text); box-shadow: 0 0 0 .5px rgba(0,0,0,.25), 0 1px 1px rgba(0,0,0,.08); }

/* ---------- TEXTEDIT ---------- */
.te-tools { height: 30px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid #e6e6e6; background: #fbfbfb; font-size: 12px; color: #6e6e73; }
.te-tools span { padding: 1px 8px; border: 1px solid #dcdce0; border-radius: 5px; background: #fff; }
.te { padding: 28px 40px 40px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.65; color: #111; outline: none; white-space: normal; }
.te h2 { font-size: 20px; margin: 0 0 14px; }
.te p { margin: 0 0 12px; }
.te a { color: var(--sel); }
.te h3 { font-size: 14px; margin: 18px 0 6px; }
.te ul { margin: 0 0 6px; padding-left: 20px; }
.te li { margin-bottom: 3px; }

/* ---------- PREVIEW ---------- */
.pv { background: #ececec; height: 100%; display: grid; place-items: center; padding: 14px; }
.pv img { max-width: 100%; max-height: 100%; height: auto; box-shadow: 0 2px 10px rgba(0,0,0,.18); }

/* ---------- CONTACT CARD ---------- */
.card { display: grid; grid-template-columns: 96px 1fr; gap: 18px; padding: 26px 28px 10px; }
.card img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.card h2 { margin: 6px 0 2px; font-size: 22px; font-weight: 700; }
.card .org { color: var(--muted); }
.card-actions { display: flex; gap: 10px; margin-top: 12px; }
.card-actions a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--sel); text-decoration: none; }
.card-actions a span { width: 34px; height: 34px; border-radius: 50%; background: #f0f0f3; display: grid; place-items: center; }
.card-actions svg { width: 17px; height: 17px; fill: none; stroke: var(--sel); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fields { margin: 8px 28px 26px; display: grid; grid-template-columns: 90px 1fr; gap: 9px 14px; font-size: 13px; border-top: 1px solid #ededf0; padding-top: 16px; }
.fields dt { color: var(--muted); text-align: right; font-size: 12px; padding-top: 1px; }
.fields dd { margin: 0; }
.fields a { color: var(--sel); text-decoration: none; }
.fields a:hover { text-decoration: underline; }

/* ---------- TERMINAL ---------- */
.t-win .bar { background: #2a2a2c; border-color: #1a1a1a; }
.t-win .title { color: #b5b5b9; }
.term { background: #1e1e1e; color: #e5e5e5; height: 100%; padding: 8px 10px; font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.45; cursor: text; }
.term div { white-space: pre-wrap; }
.term form { display: flex; gap: 7px; }
.term input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: #fff; font: inherit; caret-color: #e5e5e5; }
.term .p { color: #e5e5e5; white-space: nowrap; }

/* ---------- SAFARI ---------- */
.s-win .bar { height: 46px; background: #f4f4f6; border-bottom: 0; justify-content: flex-start; }
.s-tb { flex: 1; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 84px; height: 100%; }
.s-ic { width: 30px; height: 28px; border-radius: 6px; display: grid; place-items: center; color: #5c5c61; }
.s-ic:hover:not(:disabled) { background: rgba(0,0,0,.06); }
.s-ic:disabled { color: #bdbdc2; }
.s-ic:last-child { margin-left: auto; }
.s-addr { flex: 0 1 520px; margin: 0 auto; height: 30px; border-radius: 8px; background: #e6e6e9; display: flex; align-items: center; justify-content: center; gap: 6px; color: #6e6e73; font-size: 13px; position: relative; }
.s-addr span { color: #1d1d1f; }
.s-reload { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: #6e6e73; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; }
.s-reload:hover { background: rgba(0,0,0,.07); }
.s-tabs { flex: none; height: 32px; display: flex; padding: 0 8px 4px; background: #f4f4f6; border-bottom: 1px solid #dcdce0; }
.s-tab { flex: 0 1 260px; display: flex; align-items: center; gap: 7px; padding: 0 8px 0 10px; height: 28px; border-radius: 7px; background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.06); font-size: 12px; color: #1d1d1f; }
.s-tab img { width: 16px; height: 16px; border-radius: 3px; }
.s-tab span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-x { width: 18px; height: 18px; border-radius: 4px; font-size: 15px; line-height: 1; color: #8a8a8e; opacity: 0; }
.s-tab:hover .s-x { opacity: 1; }
.s-x:hover { background: rgba(0,0,0,.08); }
.s-load { position: relative; height: 0; flex: none; }
.s-load i { position: absolute; left: 0; top: -2px; height: 2px; width: 0; background: #0a84ff; opacity: 0; }
.s-load.go i { animation: sload 1s ease-out; }
@keyframes sload { 0% { width: 0; opacity: 1; } 80% { width: 100%; opacity: 1; } 100% { width: 100%; opacity: 0; } }
.s-body { background: #0b0b0d; }
.s-page { display: block; cursor: pointer; }
.s-page img { width: 100%; height: auto; display: block; }
.s-body iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
@media (max-width: 760px) {
  .s-tb { padding-left: 40px; }
  .s-tb .s-ic:not(:last-child) { display: none; }
  .s-tabs { display: none; }
}

/* ---------- MUSIC ---------- */
.m-win .body { background: #fafafa; padding: 14px; overflow: hidden; }
.m-embed { width: 100%; height: 450px; border: 0; border-radius: 10px; background: transparent; display: block; }

/* ---------- SOCIAL ---------- */
.soc { width: 54px; height: 54px; border-radius: 13px; display: grid; place-items: center; box-shadow: 0 2px 5px rgba(0,0,0,.22), inset 0 0 0 .5px rgba(255,255,255,.15); }
.soc svg { width: 30px; height: 30px; }
.gl-soc { width: 56px; height: 56px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); -webkit-user-drag: none; }
.f-note { display: flex; align-items: baseline; gap: 10px; margin: 16px 16px 0; padding: 12px 14px; border: 1px solid #ececf0; border-radius: 10px; background: #fafafb; }
.f-note b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.f-note span { font-size: 12.5px; color: var(--muted); }
.f-win .body .f-note + .f-grid { flex: 1; }

/* ---------- LOCKED FOLDER + ALERT ---------- */
.gl.locked { position: relative; }
.gl.locked > svg { opacity: .55; filter: grayscale(.4) drop-shadow(0 1px 1.5px rgba(0,0,0,.2)); }
.gl.locked .lock { position: absolute; right: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 50%; background: #8e8e93; display: grid; place-items: center; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.gl.locked .lock svg { width: 10px; height: 12px; filter: none; }
.alert-wrap { position: fixed; inset: 0; z-index: 7000; display: grid; place-items: center; background: rgba(0,0,0,.08); }
.alert { width: 260px; padding: 20px 16px 16px; border-radius: 12px; text-align: center; background: rgba(240,240,242,.92); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 20px 50px rgba(0,0,0,.35); animation: open .18s ease-out; }
.alert .gl { margin: 0 auto 8px; }
.alert b { display: block; font-size: 13px; margin-bottom: 6px; }
.alert p { font-size: 11.5px; color: #4b4b4f; margin: 0 0 14px; line-height: 1.4; }
.alert .mac-btn { width: 100%; padding: 5px; border: 0; cursor: default; font: inherit; }

/* ---------- DISCORD ---------- */
.d-win .bar { background: #1e1f22; border-color: #111214; }
.d-win .title { color: #b5bac1; }
.d-win .body { background: #313338; overflow: hidden; }
/* the iframe is 20px bigger than the window and clipped, which hides Discord's own scrollbars */
.d-win .body { position: relative; }
.d-embed { position: absolute; left: 0; top: 0; width: calc(100% + 20px); height: calc(100% + 20px); border: 0; display: block; }

/* ---------- DOCK ---------- */
.dock {
  position: fixed; left: 50%; bottom: 6px; transform: translateX(-50%); z-index: 4500;
  display: flex; align-items: flex-end; gap: 4px; padding: 5px 6px 6px; border-radius: 18px;
  background: rgba(255,255,255,.2); border: .5px solid rgba(255,255,255,.35);
  backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.18), 0 10px 30px rgba(0,0,0,.2);
}
.dock button { position: relative; display: block; padding-bottom: 2px; }
.app { display: block; width: 52px; height: 52px; transition: width .14s, height .14s, margin .14s; }
.app svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.app img { width: 100%; height: 100%; display: block; -webkit-user-drag: none; }
.dock button.on::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 0 2px rgba(0,0,0,.45); }
.dock button.hop .app { animation: hop .45s ease 2; }
@keyframes hop { 50% { transform: translateY(-16px); } }
.genie { position: fixed; inset: 0; z-index: 4600; pointer-events: none; }
.genie * { pointer-events: none !important; }
.genie-strip { position: absolute; left: 0; top: 0; overflow: hidden; transform-origin: 0 0; will-change: transform; }
.genie-strip > .win { box-shadow: none; border-radius: 0; }
.dock-thumb { width: 52px; height: 52px; flex: none; transition: width .3s ease, opacity .25s ease, margin .3s ease; }
.dock-thumb.pending { opacity: 0; }
.dock-thumb.leaving { width: 0; margin: 0 -2px; opacity: 0; }
.thumb-box { position: absolute; inset: 2px 0 2px; overflow: hidden; pointer-events: none; }
.thumb-win { pointer-events: none; box-shadow: 0 0 0 .5px rgba(0,0,0,.3), 0 4px 10px rgba(0,0,0,.35) !important; }
.thumb-frame { width: 100%; height: 100%; background: #e5e5ea; }
.d-win .thumb-frame { background: #313338; }
.thumb-badge { position: absolute; right: -3px; bottom: -1px; width: 22px; height: 22px; pointer-events: none; }
.dock-sep { width: 1px; align-self: stretch; margin: 6px 4px; background: rgba(255,255,255,.35); }
.tip { position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none; padding: 3px 10px; border-radius: 6px; font-size: 13px; color: #1d1d1f; background: rgba(240,240,242,.9); box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 4px 12px rgba(0,0,0,.15); }

/* ---------- CONTEXT MENU ---------- */
.ctx { position: fixed; z-index: 6000; }

/* ---------- PHONE: the same Mac desktop, fitted to a small screen ---------- */
@media (max-width: 760px) {
  :root { --mb: 30px; }
  body { font-size: 14px; }
  /* menu bar: logo, app name, wifi, battery and clock */
  .menubar { padding: 0 10px; }
  .mb-btn:not(.mb-logo), .mb-ico:nth-child(3), .mb-ico:nth-child(4) { display: none; }
  .mb-app { font-size: 14px; }
  .mb-clock { font-size: 14px; font-weight: 600; }
  .menu { max-width: calc(100vw - 16px); }

  /* desktop icons in a grid */
  .icons { display: grid; grid-template-columns: repeat(4, 1fr); align-content: start; gap: 16px 0; padding: 18px 6px 0; }
  .icon { position: static !important; width: auto; }
  .lbl { font-size: 11.5px; max-width: 86px; }
  .lasso { display: none !important; }

  /* windows fill the space between the menu bar and the dock */
  .win, .win.zoomed { left: 6px !important; top: 6px !important; width: calc(100% - 12px) !important; height: calc(100% - 82px) !important; border-radius: 12px; }
  .bar { height: 40px; }
  .lights { left: 12px; gap: 9px; }
  .lights button { width: 14px; height: 14px; }
  .title { max-width: 58%; }
  .f-side { display: none; }
  .f-win .body { margin-left: 0; }
  .f-win .bar { height: 48px; padding-left: 92px; }
  .f-win .lights { top: 17px; }
  .f-search { display: none; }
  .finder { display: block; }
  .f-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .proj, .te { padding: 20px 18px 30px; }
  .te-tools { display: none; }
  .nums { grid-template-columns: 1fr; }
  .info { grid-template-columns: 90px 1fr; }
  .card { padding: 22px 18px 10px; grid-template-columns: 76px 1fr; }
  .card img { width: 76px; height: 76px; }
  .fields { margin: 8px 18px 26px; grid-template-columns: 76px 1fr; }
  .s-tb { padding-left: 76px; }
  .s-tb .s-ic:not(:last-child) { display: none; }
  .m-win .body { padding: 10px; }

  /* dock: every app, smaller */
  .dock { bottom: max(6px, env(safe-area-inset-bottom)); max-width: calc(100% - 12px); gap: 2px; padding: 5px 6px; border-radius: 16px; overflow-x: auto; scrollbar-width: none; }
  .dock::-webkit-scrollbar { display: none; }
  .app { width: min(40px, calc((100vw - 52px) / 9)); height: min(40px, calc((100vw - 52px) / 9)); }
  .dock button { padding-bottom: 1px; }
  .dock-sep { margin: 4px 2px; }
  .dock .dock-thumb, .tip { display: none !important; }
}

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


/* =================== DARK MODE (macOS dark appearance) =================== */
:root {
  color-scheme: dark;
  --sel: #0a84ff;
  --win: #1e1e1e;
  --side: rgba(40, 40, 44, .82);
  --line: #3a3a3c;
  --text: #e8e8ea;
  --muted: #98989d;
}
/* menus */
.menu { background: rgba(40, 40, 44, .8); border-color: rgba(255,255,255,.12); box-shadow: 0 10px 34px rgba(0,0,0,.5), inset 0 0 0 .5px rgba(255,255,255,.08); }
.menu button:disabled { color: #636366; }
.menu kbd { color: #8d8d92; }
.menu hr { border-top-color: rgba(255,255,255,.12); }

/* windows */
.win { box-shadow: 0 0 0 .5px rgba(255,255,255,.14), 0 0 0 1px rgba(0,0,0,.6), 0 22px 70px rgba(0,0,0,.6), 0 6px 18px rgba(0,0,0,.35); }
.win.inactive { box-shadow: 0 0 0 .5px rgba(255,255,255,.1), 0 0 0 1px rgba(0,0,0,.5), 0 12px 36px rgba(0,0,0,.45); }
.bar { background: #2c2c2e; border-bottom-color: #111; }
.title { color: #d6d6d9; }
.win.inactive .title { color: #6e6e73; }
.win.inactive .lights button { background: #48484a; }

/* Finder */
.f-win .bar { background: #1e1e1e; border-bottom-color: #000; }
.f-win .title { color: #e8e8ea; }
.f-nav button { color: #a1a1a6; }
.f-nav button:hover:not(:disabled) { background: #3a3a3c; }
.f-nav button:disabled { color: #4a4a4e; }
.f-search { background-color: #3a3a3c; color: #e8e8ea; }
.f-search::placeholder { color: #8e8e93; }
.f-search:focus { background-color: #2c2c2e; box-shadow: 0 0 0 3px rgba(10,132,255,.45); }
.f-side { border-right-color: #000; }
.f-side h4 { color: #7c7c80; }
.f-side button.on { background: rgba(255,255,255,.1); }
.f-item.sel .gl { background: rgba(255,255,255,.1); }
.f-status { background: rgba(30,30,30,.94); border-top-color: #2c2c2e; }
.f-note, .nums div { border-color: #3a3a3c; background: #2a2a2c; }
.proj p, .proj ul { color: #d1d1d6; }
.info { border-color: #3a3a3c; }
.mac-btn:hover { background: #0071e3; }

/* Notes / TextEdit */
.te-tools { background: #2a2a2c; border-bottom-color: #111; color: #a1a1a6; }
.te-tools span { background: #3a3a3c; border-color: #48484a; color: #d1d1d6; }
.te { color: #e8e8ea; }
.te a { color: #409cff; }

/* Photos, Contacts */
.pv { background: #161616; }
.card-actions a span { background: #3a3a3c; }
.fields { border-top-color: #3a3a3c; }

/* Safari */
.s-win .bar, .s-tabs { background: #2c2c2e; }
.s-tabs { border-bottom-color: #111; }
.s-ic { color: #a1a1a6; }
.s-ic:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.s-ic:disabled { color: #4a4a4e; }
.s-addr { background: #3a3a3c; color: #a1a1a6; }
.s-addr span { color: #e8e8ea; }
.s-reload { color: #a1a1a6; }
.s-reload:hover { background: rgba(255,255,255,.1); }
.s-tab { background: #48484a; color: #e8e8ea; box-shadow: 0 0 0 .5px rgba(0,0,0,.4); }
.s-x { color: #a1a1a6; }

/* Music */
.m-win .body { background: #1e1e1e; }

/* alert, dock, tooltips */
.alert { background: rgba(44,44,46,.94); box-shadow: 0 0 0 .5px rgba(255,255,255,.14), 0 20px 50px rgba(0,0,0,.55); }
.alert b { color: #f2f2f4; }
.alert p { color: #a1a1a6; }
.dock { background: rgba(30,30,34,.42); border-color: rgba(255,255,255,.14); box-shadow: 0 0 0 .5px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35); }
.dock-sep { background: rgba(255,255,255,.2); }
.tip { background: rgba(44,44,46,.94); color: #e8e8ea; box-shadow: 0 0 0 .5px rgba(255,255,255,.14), 0 4px 12px rgba(0,0,0,.4); }
.thumb-frame { background: #2c2c2e; }


/* =================== PERFORMANCE ===================
   Live blurs are re-computed every time something moves behind them, which made the
   site lag. The wallpaper's soft look is now baked into wallpaper-soft.jpg, and the
   glass effects use smaller blurs (or none where they weren't visible). */
.desktop:not([data-wall])::before,
.desktop[data-wall="1"]::before {
  inset: 0;
  background: #0d0d10 url("wallpaper-soft.jpg") center / cover no-repeat;
  filter: none;
  transform: translateZ(0);
}
.menubar { backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); }
.menu { backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); }
.dock { backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); }
.alert { backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.f-side { backdrop-filter: none; -webkit-backdrop-filter: none; background: #28282c; }
.win { box-shadow: 0 0 0 .5px rgba(255,255,255,.14), 0 0 0 1px rgba(0,0,0,.6), 0 16px 40px rgba(0,0,0,.55); }
.win.inactive { box-shadow: 0 0 0 .5px rgba(255,255,255,.1), 0 0 0 1px rgba(0,0,0,.5), 0 10px 26px rgba(0,0,0,.4); }
.win.dragging { will-change: transform; }


/* Music: preview shown while Apple's player loads */
.m-stage { position: relative; height: 450px; }
.m-stage .m-embed { position: absolute; inset: 0; }
.m-skel { position: absolute; inset: 0; display: flex; border-radius: 10px; overflow: hidden; background: #1c1c1e; transition: opacity .35s ease; }
.m-skel.gone { opacity: 0; pointer-events: none; }
.ms-left { width: 44%; padding: 18px 18px; display: flex; flex-direction: column; background: #1c1c1e; }
.ms-logo { width: 54px; height: 12px; border-radius: 4px; background: #3a3a3c; margin-bottom: 14px; }
.ms-cover { width: 100%; aspect-ratio: 1; border-radius: 6px; object-fit: cover; background: #2c2c2e; }
.ms-left b { margin-top: 10px; font-size: 14px; color: #f2f2f4; }
.ms-left span { font-size: 13px; color: #8e8e93; }
.ms-play { margin-top: auto; height: 34px; border-radius: 17px; background: #3a3a3c; color: #d1d1d6; font-style: normal; font-weight: 600; font-size: 13px; display: grid; place-items: center; }
.ms-right { flex: 1; padding: 50px 18px; background: #2c2c2e; display: flex; flex-direction: column; gap: 14px; }
.ms-right i { height: 34px; border-radius: 6px; background: linear-gradient(90deg, #3a3a3c 0%, #48484a 50%, #3a3a3c 100%); background-size: 200% 100%; animation: msShine 1.2s linear infinite; }
.ms-right i:nth-child(2) { width: 82%; } .ms-right i:nth-child(3) { width: 64%; }
@keyframes msShine { from { background-position: 200% 0; } to { background-position: -200% 0; } }


/* =================== LIQUID GLASS (macOS Tahoe look) ===================
   Rounder windows, toolbars that blend into the window, floating sidebars,
   pill-shaped controls, a clear menu bar and a glass dock. */
:root { --r-win: 20px; --glass: rgba(255,255,255,.08); --glass-line: rgba(255,255,255,.14); }

/* menu bar: fully clear, like Tahoe */
.menubar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; text-shadow: 0 1px 3px rgba(0,0,0,.45); }
.mb-btn[aria-expanded="true"] { background: rgba(255,255,255,.2); border-radius: 7px; }
.menu { border-radius: 14px; padding: 6px; background: rgba(36,36,40,.78); border: 0; box-shadow: 0 0 0 .5px rgba(255,255,255,.16), inset 0 1px 0 rgba(255,255,255,.08), 0 14px 40px rgba(0,0,0,.5); }
.menu button { border-radius: 8px; padding: 5px 10px; }
.menu hr { margin: 5px 8px; }

/* windows */
.win { border-radius: var(--r-win); background: #1c1c1e;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.7), 0 18px 46px rgba(0,0,0,.5); }
.win.inactive { box-shadow: 0 0 0 .5px rgba(0,0,0,.6), 0 10px 28px rgba(0,0,0,.38); }
.win::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.09), inset 0 1px 0 rgba(255,255,255,.1); }
.win.zoomed { border-radius: 0; }
.bar { height: 50px; background: transparent; border-bottom: 0; }
.title { font-size: 13px; font-weight: 600; color: #e5e5ea; }
.win.inactive .title { color: #6e6e73; }
.lights { left: 18px; gap: 9px; }
.lights button { width: 13px; height: 13px; }

/* pill controls */
.mac-btn { border-radius: 999px; padding: 6px 18px; font-weight: 600; }
.te-tools { height: 40px; padding: 0 16px; gap: 6px; background: transparent; border-bottom: 1px solid rgba(255,255,255,.06); }
.te-tools span { border: 0; border-radius: 999px; padding: 3px 12px; background: var(--glass); color: #d1d1d6; }
.te { padding: 26px 40px 40px; }

/* Finder: floating sidebar, toolbar in the window */
.f-win .bar { height: 56px; background: transparent; border-bottom: 0; padding-left: 206px; gap: 12px; }
.f-win .lights { top: 22px; left: 22px; }
.f-side { top: 8px; left: 8px; bottom: 8px; width: 186px; padding: 52px 10px 10px; border-radius: 14px; border: 0;
  background: rgba(58,58,64,.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.f-win .body { margin-left: 202px; }
.f-side h4 { margin: 12px 8px 4px; }
.f-side button { border-radius: 8px; padding: 5px 8px; }
.f-side button.on { background: rgba(255,255,255,.12); }
.f-nav { background: var(--glass); border-radius: 999px; padding: 2px; gap: 0; }
.f-nav button { width: 32px; height: 28px; border-radius: 999px; }
.f-search { border-radius: 999px; height: 30px; background-color: var(--glass); }
.f-item.sel .gl { border-radius: 10px; }
.lbl { border-radius: 6px; }
.f-status { background: transparent; border-top: 1px solid rgba(255,255,255,.05); }
.nums div, .f-note { border-radius: 14px; border: 0; background: var(--glass); }
.info { border-color: rgba(255,255,255,.07); }

/* Safari */
.s-win .bar { background: transparent; height: 52px; }
.s-addr { border-radius: 999px; height: 32px; background: var(--glass); }
.s-ic { border-radius: 999px; }

/* Contacts, Photos, Music */
.card-actions a span { background: var(--glass); }
.fields { border-top-color: rgba(255,255,255,.07); }
.pv { background: #141416; }
.m-win .body { background: #1c1c1e; }
.m-embed, .m-skel { border-radius: 14px; }

/* alerts and tooltips */
.alert { border-radius: 26px; padding: 22px 18px 18px; background: rgba(40,40,44,.86); }
.alert .mac-btn { border-radius: 999px; }
.tip { border-radius: 10px; }

/* dock: Liquid Glass */
.dock { border-radius: 26px; padding: 7px 9px 8px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(255,255,255,.06), 0 14px 34px rgba(0,0,0,.35); }
.dock-sep { background: rgba(255,255,255,.22); }

@media (max-width: 760px) {
  :root { --r-win: 16px; }
  .win, .win.zoomed { border-radius: var(--r-win); }
  .f-side { display: none; }
  .f-win .body { margin-left: 0; }
  .f-win .bar { padding-left: 96px; }
  .f-win .lights { top: 21px; left: 16px; }
  .dock { border-radius: 20px; padding: 5px 6px; }
}
