/* shimul.me — a macOS-style desktop in plain CSS. */

:root {
  --menubar-h: 34px;
  --dock-h: 92px;

  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --sep: rgba(0, 0, 0, 0.08);
  --win-bg: rgba(246, 246, 248, 0.74);
  --win-border: rgba(255, 255, 255, 0.6);
  --win-highlight: rgba(255, 255, 255, 0.7);
  --card: rgba(255, 255, 255, 0.6);
  --card-hover: rgba(255, 255, 255, 0.9);
  --btn: rgba(0, 0, 0, 0.06);
  --btn-hover: rgba(0, 0, 0, 0.1);
  --accent: #0a84ff;
  --tag-bg: rgba(10, 132, 255, 0.1);
  --tag-text: #0060df;
  --menu-bg: rgba(246, 246, 248, 0.78);
  --shadow: 0 30px 80px -20px rgba(8, 10, 40, 0.55), 0 8px 24px -8px rgba(8, 10, 40, 0.3);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #7c7c82;
    --sep: rgba(255, 255, 255, 0.08);
    --win-bg: rgba(32, 32, 38, 0.66);
    --win-border: rgba(255, 255, 255, 0.14);
    --win-highlight: rgba(255, 255, 255, 0.16);
    --card: rgba(255, 255, 255, 0.05);
    --card-hover: rgba(255, 255, 255, 0.1);
    --btn: rgba(255, 255, 255, 0.1);
    --btn-hover: rgba(255, 255, 255, 0.16);
    --tag-bg: rgba(100, 170, 255, 0.14);
    --tag-text: #8cc2ff;
    --menu-bg: rgba(40, 40, 46, 0.72);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  font: 400 13.5px/1.5 var(--font);
  color: var(--text);
  background: #0a1130 url("assets/wallpaper.svg") center / cover no-repeat fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, p, dl, dd { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
img { display: block; }

/* App icons share one corner shape, whatever their source files use. */
.app img,
.p-head img,
.dropdown img,
.dock-item img:not(.round) { border-radius: 22.5%; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 8px; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 9999;
  padding: 8px 14px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 600;
}
.skip:focus { top: 44px; }

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

.menubar {
  position: fixed; inset: 0 0 auto; z-index: 5000;
  height: var(--menubar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  color: #fff;
  font-size: 13.5px;
  background: linear-gradient(rgba(10, 12, 40, 0.38), rgba(10, 12, 40, 0.18));
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.mb-left { display: flex; align-items: center; gap: 2px; height: 100%; }
.mb-logo { width: 16px; height: 16px; margin: 0 10px 0 4px; border-radius: 4px; }
.mb-app { font-weight: 700; padding: 0 10px; }

.menu { position: relative; height: 100%; display: flex; align-items: center; }

.mb-item {
  height: 24px; padding: 0 10px; border-radius: 7px;
  font-weight: 500; color: #fff;
}
.mb-item:hover,
.mb-item[aria-expanded="true"] { background: rgba(255, 255, 255, 0.18); }

.dropdown {
  position: absolute; top: calc(100% - 2px); left: 0;
  min-width: 220px; padding: 6px;
  border-radius: 14px;
  background: var(--menu-bg);
  border: 1px solid var(--win-border);
  box-shadow: var(--shadow), inset 0 1px 0 var(--win-highlight);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  color: var(--text); text-shadow: none;
  opacity: 0; transform: translateY(-4px) scale(0.98); transform-origin: top left;
  pointer-events: none;
  transition: opacity 0.14s var(--ease), transform 0.14s var(--ease);
}
.menu.open .dropdown { opacity: 1; transform: none; pointer-events: auto; }

.dropdown button,
.dropdown a {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px; border-radius: 8px;
  text-align: left; font-size: 13.5px;
}
.dropdown a span { margin-left: auto; opacity: 0.5; }
.dropdown img { width: 18px; height: 18px; border-radius: 5px; }
.dropdown button:hover,
.dropdown a:hover,
.dropdown button:focus-visible,
.dropdown a:focus-visible { background: var(--accent); color: #fff; outline: none; }
.dropdown hr { border: 0; height: 1px; margin: 5px 10px; background: var(--sep); }

.mb-right { display: flex; align-items: center; gap: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Windows ---------- */

.desktop {
  position: fixed;
  inset: var(--menubar-h) 0 0 0;
  overflow: hidden;
}

.window {
  position: absolute;
  display: flex; flex-direction: column;
  max-height: calc(100vh - var(--menubar-h) - var(--dock-h) - 24px);
  border-radius: 24px;
  background: var(--win-bg);
  border: 1px solid var(--win-border);
  box-shadow: var(--shadow), inset 0 1px 0 var(--win-highlight);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  overflow: hidden;
  outline: none;
  transition: box-shadow 0.25s var(--ease);
}

.window[hidden] { display: none; }

.window:not(.active) { box-shadow: 0 20px 50px -20px rgba(8, 10, 40, 0.45); }

.window.opening { animation: win-open 0.32s var(--spring); }
.window.closing { animation: win-close 0.18s var(--ease) forwards; pointer-events: none; }

@keyframes win-open {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: none; }
}
.window.pulse { animation: win-pulse 0.36s var(--ease); }
@keyframes win-pulse {
  40% { transform: scale(1.025); }
}

@keyframes win-close {
  to { opacity: 0; transform: scale(0.94); }
}

.window.minimizing {
  transition: transform 0.42s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.42s ease-in;
  transform: translate(var(--min-x), var(--min-y)) scale(0.06);
  opacity: 0;
  pointer-events: none;
}

.window.zoomed {
  left: 12px !important; top: 10px !important;
  width: calc(100vw - 24px) !important;
  height: calc(100vh - var(--menubar-h) - var(--dock-h) - 20px) !important;
  max-height: none;
  transition: left 0.3s var(--ease), top 0.3s var(--ease), width 0.3s var(--ease), height 0.3s var(--ease);
}

.titlebar {
  position: relative;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 18px;
  user-select: none; -webkit-user-select: none;
  cursor: default;
  touch-action: none;
}

.lights { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }

.light {
  width: 13px; height: 13px; border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
  position: relative;
}
.light.close { background: #ff5f57; }
.light.min { background: #febc2e; }
.light.zoom { background: #28c840; }

.window:not(.active) .light { background: rgba(128, 128, 128, 0.35); }

.light::after {
  content: ""; position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; line-height: 13px; text-align: center;
  color: rgba(0, 0, 0, 0.55);
  opacity: 0;
}
.lights:hover .light::after { opacity: 1; }
.lights:hover .light.close { background: #ff5f57; }
.lights:hover .light.min { background: #febc2e; }
.lights:hover .light.zoom { background: #28c840; }
.light.close::after { content: "×"; font-size: 11px; }
.light.min::after { content: "−"; }
.light.zoom::after { content: "+"; }

.wtitle { font-weight: 600; font-size: 13.5px; }
.wsub { position: absolute; right: 20px; color: var(--text-3); font-size: 12px; }
.window:not(.active) .wtitle { color: var(--text-3); }

.wbody { overflow: auto; overscroll-behavior: contain; }

/* ---------- About window ---------- */

.win-about { width: 380px; }

.about { padding: 8px 32px 26px; text-align: center; }

.avatar {
  width: 112px; height: 112px; margin: 6px auto 16px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(255, 255, 255, 0.35);
}

.about h1 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
}
.about-role { margin-top: 2px; color: var(--text-2); font-size: 14px; }

.specs { margin: 22px 0 20px; display: grid; gap: 7px; text-align: left; font-size: 12.5px; }
.specs div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; }
.specs dt { text-align: right; font-weight: 600; }
.specs dd { color: var(--text-2); }

.buttons { display: flex; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 16px; border-radius: 99px;
  background: var(--btn);
  font-size: 13px; font-weight: 500;
  box-shadow: inset 0 1px 0 var(--win-highlight), 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
  cursor: pointer;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #0077ed; }

.about-links { display: flex; justify-content: center; gap: 18px; margin-top: 18px; font-size: 13px; }
.about-links a { color: var(--accent); }
.about-links a:hover { text-decoration: underline; }

.fine { margin-top: 18px; font-size: 11px; color: var(--text-3); }
.fine a:hover { text-decoration: underline; }

/* ---------- Projects window ---------- */

.win-work { width: 560px; }

.work { padding: 6px 18px 20px; }

.apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.app {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 16px 8px 14px; border-radius: 16px;
  transition: background 0.2s var(--ease);
  cursor: pointer;
}
.app:hover { background: var(--card-hover); }
.app:focus-visible { background: var(--card-hover); }
.app img {
  width: 64px; height: 64px; margin-bottom: 10px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25));
  transition: transform 0.3s var(--spring);
}
.app:hover img { transform: translateY(-3px) scale(1.04); }
.app-name { font-weight: 600; font-size: 13.5px; }
.app-line { color: var(--text-2); font-size: 12px; line-height: 1.35; margin-top: 2px; }

.stars {
  margin-top: 6px;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.stars[hidden] { display: none; }

/* ---------- Project windows ---------- */

.win-project { width: 640px; }

.project { padding: 4px 26px 26px; }

.p-head { display: grid; grid-template-columns: 80px 1fr auto; gap: 18px; align-items: center; }
.p-head img { width: 80px; height: 80px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.28)); }
.p-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.p-head p { color: var(--text-2); font-size: 13.5px; }
.p-head .p-meta { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.p-meta .stars { margin: 0 0 0 6px; }
.p-actions { display: flex; flex-direction: column; gap: 8px; }

.shot {
  width: 100%; height: auto; margin: 22px 0 18px;
  border-radius: 14px;
  border: 1px solid var(--sep);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.35);
  background: var(--card);
}

.p-desc { font-size: 14px; line-height: 1.6; color: var(--text-2); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags li { padding: 3px 10px; border-radius: 99px; background: var(--tag-bg); color: var(--tag-text); font-size: 12px; font-weight: 500; }

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

.dock {
  position: fixed; left: 50%; bottom: 10px; z-index: 4000;
  transform: translateX(-50%);
}

.dock ul {
  display: flex; align-items: flex-end; gap: 6px;
  padding: 8px 10px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.dock li { display: flex; }

.dock .sep { width: 1px; height: 46px; margin: 0 4px 5px; background: rgba(255, 255, 255, 0.28); }

.dock-item {
  position: relative;
  display: block;
  width: 56px; height: 56px;
  transition: margin 0.2s var(--ease);
  cursor: pointer;
}
.dock-item img {
  width: 100%; height: 100%;
  transform-origin: 50% 100%;
  transition: scale 0.2s var(--ease), translate 0.2s var(--ease);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  pointer-events: none;
}
.dock-item img.round { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }

.dock-item::after {
  content: "";
  position: absolute; left: 50%; bottom: -6px;
  width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  opacity: 0; transition: opacity 0.2s;
}
.dock-item.running::after { opacity: 1; }

.dock-item.bounce { animation: bounce 0.6s var(--ease); }
@keyframes bounce {
  0%, 100% { translate: 0 0; }
  35% { translate: 0 -16px; }
  65% { translate: 0 0; }
  80% { translate: 0 -5px; }
}

.tip {
  position: absolute; left: 50%; bottom: calc(100% + 14px);
  transform: translateX(-50%);
  padding: 4px 10px; border-radius: 8px;
  white-space: nowrap;
  font-size: 12.5px; font-weight: 500;
  color: var(--text);
  background: var(--menu-bg);
  border: 1px solid var(--win-border);
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s;
}

.dock-item:focus-visible .tip { opacity: 1; }

@media (hover: hover) {
  .dock-item:hover { z-index: 2; margin: 0 13px; }
  .dock-item:hover img { scale: 1.45; translate: 0 -6px; }
  .dock li:has(+ li > .dock-item:hover) .dock-item,
  .dock li:has(> .dock-item:hover) + li .dock-item { margin: 0 5px; }
  .dock li:has(+ li > .dock-item:hover) img,
  .dock li:has(> .dock-item:hover) + li img { scale: 1.18; translate: 0 -2px; }
  .dock-item:hover .tip { opacity: 1; bottom: calc(100% + 40px); }
}

/* ---------- Phones ---------- */

@media (max-width: 720px) {
  :root { --dock-h: 84px; }

  .mb-app ~ .menu { display: none; }

  .js .window {
    left: 8px !important; right: 8px; top: 8px !important;
    width: auto !important;
    height: calc(100% - var(--dock-h) - 16px) !important;
    max-height: none;
    border-radius: 22px;
  }
  .js .window .titlebar { touch-action: auto; }
  .lights { gap: 10px; }
  .light { width: 15px; height: 15px; }
  .light.min, .light.zoom { display: none; }

  .about { padding: 4px 22px 24px; }
  .apps { grid-template-columns: repeat(2, 1fr); }
  .project { padding: 4px 18px 22px; }
  .p-head { grid-template-columns: 64px 1fr; }
  .p-head img { width: 64px; height: 64px; }
  .p-actions { grid-column: 1 / -1; flex-direction: row; }
  .p-actions .btn { flex: 1; }

  .dock .social { display: none; }
  .dock ul { gap: 4px; padding: 7px 8px; border-radius: 22px; }
  .dock-item { width: 48px; height: 48px; }
  .dock .sep { height: 38px; margin: 0 3px 5px; }
}

/* ---------- Without JavaScript: a plain readable page ---------- */

.no-js .desktop { position: static; padding: calc(var(--menubar-h) + 24px) 16px 140px; overflow: visible; }
.no-js .window,
.no-js .window[hidden] { position: relative; display: flex; margin: 0 auto 24px; max-width: 640px; width: auto; max-height: none; }
.no-js .lights,
.no-js .menu,
.no-js .dock,
.no-js .buttons { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --win-bg: rgba(246, 246, 248, 0.97); --menu-bg: rgba(246, 246, 248, 0.98); }
  @media (prefers-color-scheme: dark) {
    :root { --win-bg: rgba(32, 32, 38, 0.97); --menu-bg: rgba(40, 40, 46, 0.98); }
  }
}
