/* Extra desktop features on top of index.html. All artwork here is CSS; swap in your own files under assets/ if you like. */

/* ---------- boot + sign-in ---------- */
#boot { display: none; position: fixed; inset: 0; z-index: 100000; color: #fff; user-select: none; cursor: default;
  font: 11pt "Segoe UI", "SegoeUI", "Noto Sans", Tahoma, sans-serif; }
html.boot #boot { display: block; }
html.boot #desk { visibility: hidden; }
#boot .stage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity .5s; }
#boot .stage.gone { opacity: 0; pointer-events: none; }
#boot .skip { position: absolute; right: 22px; bottom: 18px; z-index: 2; padding: 4px 12px; font-size: 9pt; color: #fffc;
  background: none; border: 1px solid #fff4; border-radius: 3px; cursor: pointer; }
#boot .skip:hover { color: #fff; border-color: #fff9; background: #fff1; }

/* Starting Windows: four colored lights swirl in and become the four panes of the logo */
#boot .startup { background: #000; }
.lights { position: relative; width: 150px; height: 150px; margin-top: -60px; }
.lights i { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle, #fff, var(--c) 45%); box-shadow: 0 0 16px 5px var(--c), 0 0 44px 12px color-mix(in srgb, var(--c) 45%, transparent);
  animation: light 1.7s cubic-bezier(.45, 0, .25, 1) forwards; opacity: 0; }
/* --x/--y: where the light starts, --fx/--fy: the middle of its pane */
.lights i:nth-child(1) { --c: #ff5a2a; --x: -190px; --y: -110px; --r: 220deg; --fx: -32px; --fy: -19px; }
.lights i:nth-child(2) { --c: #7fd11b; --x: 190px; --y: -120px; --r: -180deg; --fx: 23px; --fy: -19px; animation-delay: .1s; }
.lights i:nth-child(3) { --c: #22a7ff; --x: -170px; --y: 130px; --r: 170deg; --fx: -37px; --fy: 25px; animation-delay: .2s; }
.lights i:nth-child(4) { --c: #ffc414; --x: 180px; --y: 120px; --r: -230deg; --fx: 16px; --fy: 25px; animation-delay: .3s; }
@keyframes light {
  0% { opacity: 0; transform: rotate(var(--r)) translate(var(--x), var(--y)) scale(.4); }
  20% { opacity: 1; }
  80% { opacity: 1; transform: rotate(0) translate(var(--fx), var(--fy)) scale(1.1); }
  100% { opacity: 0; transform: rotate(0) translate(var(--fx), var(--fy)) scale(2.4); }
}
.lights svg { position: absolute; left: 15px; top: 15px; width: 120px; height: 120px; overflow: visible;
  animation: glow 2.4s 2.3s ease-in-out infinite alternate; filter: drop-shadow(0 0 6px #ffffff40); }
.lights svg path { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pane .7s ease-out forwards; }
.lights svg path:nth-child(1) { animation-delay: 1.25s; } .lights svg path:nth-child(2) { animation-delay: 1.35s; }
.lights svg path:nth-child(3) { animation-delay: 1.45s; } .lights svg path:nth-child(4) { animation-delay: 1.55s; }
@keyframes pane { from { opacity: 0; transform: scale(.4); filter: brightness(2.2); } to { opacity: 1; transform: none; filter: none; } }
@keyframes glow { to { filter: drop-shadow(0 0 14px #ffffff55) brightness(1.1); } }
.startup p { margin: 34px 0 0; font-size: 17pt; font-weight: 300; letter-spacing: .3px; color: #c8c8c8; opacity: 0;
  animation: fadein .6s .5s forwards; }
@keyframes fadein { to { opacity: 1; } }

/* sign-in screen */
#boot .logon { opacity: 0; transition: opacity .6s; overflow: hidden;
  background: radial-gradient(ellipse 70% 55% at 50% 42%, #3d8fd6, #1c5aa6 55%, #0d2f66); }
#boot .logon.show { opacity: 1; }
.logon::before, .logon::after { content: ""; position: absolute; inset: -20%; pointer-events: none;
  background: repeating-conic-gradient(from 200deg at 50% 120%, #fff0 0 7deg, #ffffff10 8deg 9deg, #fff0 10deg 17deg);
  animation: rays 30s linear infinite; }
.logon::after { background: radial-gradient(ellipse 45% 30% at 30% 80%, #7fd4ff33, transparent 70%),
  radial-gradient(ellipse 50% 30% at 75% 15%, #ffffff22, transparent 70%); animation: none; }
@keyframes rays { to { transform: rotate(8deg) scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .logon::before { animation: none; } }
.usertile { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.usertile .pic { width: 136px; height: 136px; padding: 9px; border-radius: 9px; cursor: pointer;
  background: linear-gradient(135deg, #fffffff2, #d5e6f7 45%, #a9c6e8 55%, #eef5fc);
  box-shadow: 0 6px 18px #0008, inset 0 0 0 1px #fff, 0 0 0 1px #2b4f7d; transition: box-shadow .2s, transform .2s; }
.usertile .pic:hover { box-shadow: 0 6px 22px #000a, inset 0 0 0 1px #fff, 0 0 0 1px #6fb6ff, 0 0 26px #8fd0ff99; transform: translateY(-1px); }
.usertile .pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; border: 1px solid #6f8db3; display: block; }
.usertile .who { font-size: 18pt; font-weight: 300; text-shadow: 0 2px 6px #0009; }
.usertile .role { margin-top: -10px; font-size: 10pt; color: #d7e8fb; text-shadow: 0 1px 3px #0008; }
.usertile .go { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.usertile .go span { font-size: 10pt; color: #e8f3ff; text-shadow: 0 1px 2px #0008; }
.usertile .arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #0c3e7a; cursor: pointer; padding: 0; min-width: 0; min-height: 0;
  display: grid; place-items: center; color: #fff; font-size: 16px;
  background: radial-gradient(circle at 50% 25%, #bfe8ff, #3b9be6 45%, #0f5bb5 70%, #0a3f86);
  box-shadow: inset 0 0 0 1px #ffffff99, 0 1px 4px #0007; }
.usertile .arrow:hover { filter: brightness(1.15); box-shadow: inset 0 0 0 1px #fff, 0 0 12px #9fdcff; }
.usertile .arrow::before, .usertile .arrow::after { content: none !important; }
.welcome { display: none; align-items: center; gap: 14px; font-size: 22pt; font-weight: 300; text-shadow: 0 2px 6px #0009; }
.logon.signing .go, .logon.signing .role { display: none; }
.logon.signing .welcome { display: flex; }
.spin { width: 26px; height: 26px; border-radius: 50%; animation: spin 1s linear infinite;
  background: conic-gradient(#fff0, #fff 80%, #fff0 81%); -webkit-mask: radial-gradient(circle, transparent 52%, #000 54%);
  mask: radial-gradient(circle, transparent 52%, #000 54%); }
@keyframes spin { to { transform: rotate(1turn); } }
.logon .brand { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; font-size: 10pt; color: #ffffffa8;
  letter-spacing: .3px; }

/* ---------- Aero Peek ---------- */
#desk .window { transition: opacity .25s, box-shadow .25s; }
#desk.peeking .window:not(.peek-target):not(.dragging):not(.snap-clone) { border-color: transparent;
  box-shadow: inset 0 0 0 1px #ffffffb0, 0 0 0 1px #0005, 0 0 14px #ffffff40; }
#desk.peeking .window:not(.peek-target):not(.snap-clone) > *,
#desk.peeking .window:not(.peek-target):not(.snap-clone)::before,
#desk.peeking .window:not(.peek-target):not(.snap-clone)::after { opacity: 0; transition: opacity .25s; }
#desk.peeking .window.peek-target { z-index: 1999 !important; }
@media (prefers-reduced-motion: reduce) { #desk .window, .snap-clone { transition: none !important; } }

/* ---------- taskbar thumbnails ---------- */
.snap-clone { position: absolute; left: 0; top: 0; margin: 0 !important; transform-origin: 0 0; pointer-events: none;
  animation: none !important; display: flex !important; opacity: 1 !important; visibility: visible !important; }
.snap-clone .rz { display: none; }
#thumbs { position: absolute; z-index: 1500; bottom: 44px; display: flex; gap: 6px; padding: 7px; opacity: 0; pointer-events: none;
  border: 1px solid #000a; border-radius: 6px; transition: opacity .15s, transform .15s; transform: translateY(6px);
  background: linear-gradient(#ffffff55, #ffffff1a 30%, #1c3b6acc); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px #ffffff66, 0 3px 12px #0007; }
#thumbs.show { opacity: 1; pointer-events: auto; transform: none; }
.thumb { position: relative; width: 246px; padding: 4px 5px 6px; border: 1px solid transparent; border-radius: 4px; color: #fff; cursor: default; }
.thumb:hover { border-color: #ffffff8c; background: linear-gradient(#ffffff40, #ffffff12); box-shadow: inset 0 0 0 1px #ffffff26; }
.thumb .cap { display: flex; align-items: center; gap: 6px; height: 20px; font-size: 9pt; text-shadow: 0 1px 2px #000;
  white-space: nowrap; overflow: hidden; padding-right: 18px; }
.thumb .cap img { width: 16px; height: 16px; flex: none; }
.thumb .x { position: absolute; right: 5px; top: 5px; width: 18px; height: 16px; border-radius: 3px; display: none; place-items: center;
  font: 700 9pt/1 Arial, sans-serif; color: #fff; border: 1px solid #5b0e0e;
  background: linear-gradient(#e8a493, #d1694f 45%, #c4361a 50%, #d2785f); }
.thumb:hover .x { display: grid; }
.thumb .shot { position: relative; height: 146px; margin-top: 4px; overflow: hidden; }
.shot .frame { position: absolute; }
@media (max-width: 760px) { #thumbs { display: none !important; } }

/* ---------- Alt+Tab switcher ---------- */
#switcher { position: absolute; z-index: 3000; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none;
  flex-direction: column; align-items: center; gap: 10px; padding: 14px 16px 16px; max-width: calc(var(--W) - 40px);
  border: 1px solid #000b; border-radius: 8px; color: #fff;
  background: linear-gradient(#ffffff60, #ffffff22 25%, #12325fd9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px #ffffff80, 0 6px 30px #000a; }
#switcher.show { display: flex; animation: open .12s ease-out; }
#switcher .name { font-size: 11pt; text-shadow: 0 1px 3px #000; height: 20px; }
#switcher .row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sw { position: relative; width: 168px; padding: 6px; border: 1px solid transparent; border-radius: 5px; }
.sw.sel { border-color: #ffffffb3; background: linear-gradient(#ffffff59, #ffffff14); box-shadow: inset 0 0 0 1px #ffffff40, 0 0 10px #a6dcff66; }
.sw .shot { height: 104px; }
.sw .ic { position: absolute; left: 50%; bottom: 0; width: 32px; height: 32px; margin-left: -16px; filter: drop-shadow(0 2px 3px #000a); }
.desk-card { position: absolute; inset: 0; border-radius: 3px; box-shadow: 0 0 0 1px #0006, 0 2px 6px #0006;
  background: var(--wall, #1b6fc2 url(win7.webp) center / cover no-repeat); }

/* ---------- Flip 3D ---------- */
#flip { position: absolute; inset: 0; z-index: 3000; display: none; perspective: 1300px; perspective-origin: 45% 35%;
  background: radial-gradient(ellipse at 40% 60%, #0003, #0009); }
#flip.show { display: block; animation: fadein .2s forwards; opacity: 0; }
#flip.leaving { animation: fadeout .2s forwards; }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }
#flip .stack { position: absolute; inset: 0; transform-style: preserve-3d; }
.card { position: absolute; transform-origin: 50% 50%; transition: transform .45s cubic-bezier(.3, .7, .3, 1), opacity .45s, filter .45s;
  cursor: pointer; transform-style: preserve-3d; }
.card .shot { position: absolute; inset: 0; overflow: visible; }
.card.front { filter: drop-shadow(0 0 18px #8fd0ffaa); }
#flip .hint { position: absolute; left: 0; right: 0; bottom: 56px; text-align: center; color: #fffd; font-size: 10pt;
  text-shadow: 0 1px 3px #000; pointer-events: none; }
.flip-btn { all: unset; width: 34px; height: 34px; margin-right: 4px; border-radius: 3px; display: grid; place-items: center; cursor: default;
  border: 1px solid transparent; }
.flip-btn:hover { border-color: #ffffff8c; background: linear-gradient(#ffffff66, #ffffff22 48%, #ffffff0a 50%, #aad7ff38); }
.flip-btn img { width: 26px; height: 26px; filter: drop-shadow(0 1px 2px #0009); }
/* Flip 3D shows only the stack, not the real windows */
#desk.flipping .window:not(.snap-clone) { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .card { transition: none !important; } }
@media (max-width: 760px) { .flip-btn { display: none !important; } }

/* ---------- desktop context menu ---------- */
.ctx { position: absolute; z-index: 4000; min-width: 190px; width: max-content; margin: 0; padding: 2px; list-style: none; color: #000;
  font: 9pt "Segoe UI", "SegoeUI", "Noto Sans", Tahoma, sans-serif; background: #f0f0f0; border: 1px solid #979797;
  box-shadow: 3px 3px 4px -1px #0007; user-select: none; }
.ctx::before { content: ""; position: absolute; left: 27px; top: 2px; bottom: 2px; width: 1px; background: #e2e3e3; box-shadow: 1px 0 #fff; }
.ctx li { font: 9pt "Segoe UI", "SegoeUI", "Noto Sans", Tahoma, sans-serif; position: relative; display: flex; align-items: center; height: 22px; padding: 0 22px 0 32px; border: 1px solid transparent;
  border-radius: 3px; cursor: default; white-space: nowrap; }
.ctx li:hover, .ctx li.open { border-color: #aecff7; background: linear-gradient(#f2f7fe, #dbeafd); }
.ctx li.off { color: #8d8d8d; }
.ctx li.sep { height: 0; margin: 3px 2px 3px 30px; padding: 0; border: 0; border-top: 1px solid #e0e0e0; border-bottom: 1px solid #fff;
  border-radius: 0; background: none; }
.ctx li b { font-weight: 600; }
.ctx li .mk { position: absolute; left: 8px; width: 16px; text-align: center; font-size: 10px; }
.ctx li img { position: absolute; left: 6px; width: 16px; height: 16px; }
.ctx li.sub::after { content: ""; position: absolute; right: 6px; top: 50%; margin-top: -4px; border: 4px solid transparent;
  border-left-color: #000; }
.ctx li > .ctx { display: none; left: 100%; top: -3px; }
.ctx li.open > .ctx { display: block; }
.ctx.flip-x li > .ctx { left: auto; right: 100%; }

/* icon sizes from View */
.icons.large .icon img { width: 64px; height: 64px; }
.icons.large .icon { width: 100px; }
.icons.small .icon img { width: 32px; height: 32px; }
.icons.small .icon { width: 74px; font-size: 8.5pt; }
.icons.hidden { display: none; }
.icons.refresh { opacity: 0; }

/* ---------- Personalize ---------- */
#personalize { left: 200px; top: 50px; width: min(760px, calc(var(--W) - 240px)); height: min(560px, calc(var(--H) - 110px)); display: none; }
#personalize .main { padding: 16px 22px; }
#personalize h2 { margin: 0 0 4px; font-size: 13pt; font-weight: 400; color: #1e395b; border: 0; }
#personalize .lead { margin: 0 0 14px; color: #444; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme { padding: 6px; border: 1px solid transparent; border-radius: 3px; text-align: center; cursor: default; }
.theme:hover { border-color: #b8d6fb; background: linear-gradient(#fafcfe, #ebf3fd); }
.theme.sel { border-color: #84acdd; background: linear-gradient(#e4f0fd, #cee3fc); }
.theme .pv { position: relative; height: 86px; border-radius: 2px; box-shadow: 0 0 0 1px #8a9bb0, 2px 2px 5px #0003;
  background: var(--pv); background-size: cover; background-position: center; overflow: hidden; }
.theme .pv::after { content: ""; position: absolute; right: 8px; bottom: 8px; width: 34px; height: 24px; border-radius: 2px;
  background: var(--sw); box-shadow: inset 0 0 0 1px #fff9, 0 1px 3px #0006; }
.theme span { display: block; margin-top: 5px; }
.pz-bar { display: flex; gap: 18px; margin-top: 18px; padding-top: 12px; border-top: 1px solid #e2e9f1; }
.pz-bar .opt { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border: 1px solid transparent; border-radius: 3px; cursor: default; color: #0033bc; }
.pz-bar .opt:hover { border-color: #b8d6fb; background: linear-gradient(#fafcfe, #ebf3fd); text-decoration: underline; }
.pz-bar .opt i { width: 40px; height: 30px; border-radius: 2px; box-shadow: inset 0 0 0 1px #fff9, 0 0 0 1px #8a9bb0; background: var(--sw); }
.pz-bar .opt small { display: block; color: #555; }
.swatches { display: grid; grid-template-columns: repeat(8, 44px); gap: 10px; margin: 6px 0 16px; }
#personalize .swatch, #personalize .swatch:hover, #personalize .swatch:focus, #personalize .swatch:active { width: 44px; height: 44px; padding: 0; min-width: 0; min-height: 0; border-radius: 3px; border: 1px solid #6f7f93;
  background: linear-gradient(#fff8, #fff0 50%), var(--c); box-shadow: inset 0 0 0 1px #fffa; }
.swatch::before, .swatch::after { content: none !important; }
#personalize .swatch.sel { outline: 2px solid #3d7fd8; outline-offset: 2px; }
.pz-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.pz-row input[type=range] { width: 260px; }
.pz-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.pz-panel[hidden] { display: none; }
@media (max-width: 760px) {
  #personalize { left: 6px !important; top: 6px !important; width: calc(var(--W) - 12px) !important; height: calc(var(--H) - 52px) !important; }
  .swatches { grid-template-columns: repeat(4, 44px); }
}

/* personalized colors (only once something was picked, so the default look stays exactly as designed) */
html.themed .window { --w7-w-bg: var(--glass); }
html.themed .window:not(.active) { --w7-w-bg: color-mix(in srgb, var(--glass) 40%, #e7eef6); }
html.themed .window.glass::before { opacity: var(--glass-a); }
html.themed .taskbar { background: linear-gradient(#ffffff6b, #ffffff1f 6%,
  color-mix(in srgb, color-mix(in srgb, var(--glass) 70%, #000) calc(var(--glass-a) * 110%), transparent) 50%,
  color-mix(in srgb, color-mix(in srgb, var(--glass) 40%, #000) calc(var(--glass-a) * 140%), transparent)); }
html.themed .startmenu { background: linear-gradient(color-mix(in srgb, color-mix(in srgb, var(--glass) 70%, #000) 85%, transparent),
  color-mix(in srgb, color-mix(in srgb, var(--glass) 30%, #000) 90%, transparent)); }
html.opaque .window.glass::after, html.opaque .taskbar, html.opaque .startmenu, html.opaque #thumbs, html.opaque #switcher {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.opaque .window.glass::before { opacity: 1; }
html.opaque .taskbar { background: linear-gradient(color-mix(in srgb, var(--glass, #74b8fc) 60%, #000),
  color-mix(in srgb, var(--glass, #74b8fc) 30%, #000)); }
