/* ===== Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --menubar-h: 28px;
  --accent: #0a84ff;
  --window-radius: 12px;
  --blur: saturate(180%) blur(20px);
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  color: var(--text);
}

.hidden { display: none !important; }

/* ===== Boot screen ===== */
#boot {
  position: fixed; inset: 0; z-index: 9999;
  background: #000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 60px;
  transition: opacity 0.6s ease;
}
#boot.fade { opacity: 0; pointer-events: none; }
.boot-logo {
  width: 90px; height: 90px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.05 12.04c-.03-2.6 2.12-3.85 2.22-3.91-1.21-1.77-3.09-2.01-3.76-2.04-1.6-.16-3.12.94-3.93.94-.81 0-2.06-.92-3.39-.89-1.74.03-3.35 1.01-4.25 2.57-1.81 3.15-.46 7.81 1.3 10.37.86 1.25 1.88 2.66 3.22 2.61 1.29-.05 1.78-.84 3.34-.84 1.56 0 2 .84 3.37.81 1.39-.02 2.27-1.28 3.12-2.54.98-1.46 1.39-2.87 1.41-2.94-.03-.01-2.71-1.04-2.74-4.13zM14.6 4.56c.71-.86 1.19-2.06 1.06-3.25-1.02.04-2.26.68-2.99 1.54-.66.76-1.23 1.97-1.08 3.13 1.14.09 2.3-.58 3.01-1.42z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.05 12.04c-.03-2.6 2.12-3.85 2.22-3.91-1.21-1.77-3.09-2.01-3.76-2.04-1.6-.16-3.12.94-3.93.94-.81 0-2.06-.92-3.39-.89-1.74.03-3.35 1.01-4.25 2.57-1.81 3.15-.46 7.81 1.3 10.37.86 1.25 1.88 2.66 3.22 2.61 1.29-.05 1.78-.84 3.34-.84 1.56 0 2 .84 3.37.81 1.39-.02 2.27-1.28 3.12-2.54.98-1.46 1.39-2.87 1.41-2.94-.03-.01-2.71-1.04-2.74-4.13zM14.6 4.56c.71-.86 1.19-2.06 1.06-3.25-1.02.04-2.26.68-2.99 1.54-.66.76-1.23 1.97-1.08 3.13 1.14.09 2.3-.58 3.01-1.42z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.boot-progress {
  width: 200px; height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px; overflow: hidden;
}
.boot-bar {
  width: 0; height: 100%;
  background: #fff; border-radius: 3px;
  animation: boot-fill 2.4s ease forwards;
}
@keyframes boot-fill { to { width: 100%; } }

/* ===== Desktop ===== */
#desktop {
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(120, 90, 255, 0.55), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(255, 120, 180, 0.45), transparent 50%),
    radial-gradient(circle at 60% 85%, rgba(80, 200, 255, 0.5), transparent 50%),
    linear-gradient(160deg, #4a3b8f, #7b4ba8 40%, #c25b9e 75%, #f0915b);
  background-size: cover;
  animation: desktop-in 0.8s ease;
}
@keyframes desktop-in { from { opacity: 0; } to { opacity: 1; } }

/* ===== Menu bar ===== */
#menubar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--menubar-h);
  background: rgba(255,255,255,0.18);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 5000;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.menu-left, .menu-right { display: flex; align-items: center; gap: 2px; }
.menu-item {
  padding: 2px 8px; border-radius: 5px;
  cursor: default; line-height: 1.4;
  transition: background 0.12s;
}
.menu-left .menu-item:hover, .menu-right .menu-item:hover, .dropdown-item:hover { background: rgba(255,255,255,0.25); }
.menu-bold { font-weight: 600; }
.menu-logo { font-size: 15px; padding: 2px 9px; }
.menu-logo::before { content: "\f8ff"; font-family: -apple-system, sans-serif; }
.menu-logo.has-logo { display: inline-block; width: 16px; height: 16px; padding: 0; margin: 0 7px;
  background-size: contain; background-repeat: no-repeat; background-position: center; vertical-align: middle; }
.menu-logo.has-logo::before { content: ""; }
.boot-logo.has-logo { -webkit-mask: none; mask: none; background-color: transparent;
  background-size: contain; background-repeat: no-repeat; background-position: center; }
.menu-right .menu-item { font-size: 13px; }

/* ===== Dropdown menus ===== */
.dropdown {
  position: fixed; top: 26px; left: 8px;
  min-width: 240px;
  background: rgba(245,245,245,0.7);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 0.5px solid rgba(255,255,255,0.5);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  padding: 5px;
  z-index: 6000;
  font-size: 13px;
  animation: drop-in 0.12s ease;
}
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dropdown-item { padding: 5px 10px; border-radius: 5px; cursor: default; }
.dropdown-sep { height: 1px; background: rgba(0,0,0,0.12); margin: 5px 8px; }

/* ===== Desktop icons ===== */
#desktop-icons {
  position: absolute; top: 44px; right: 16px;
  display: flex; flex-direction: column; gap: 4px;
  align-items: center;
}
.desktop-icon {
  width: 88px; padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  border-radius: 8px; cursor: pointer;
  transition: background 0.12s;
}
.desktop-icon:hover { background: rgba(255,255,255,0.18); }
.desktop-icon.selected { background: rgba(10,132,255,0.35); }
.desktop-icon .glyph {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.3));
}
.desktop-icon .label {
  font-size: 12px; color: #fff; text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  line-height: 1.2; word-break: break-word;
}

/* ===== Windows ===== */
.window {
  position: absolute;
  min-width: 320px; min-height: 200px;
  background: rgba(250,250,250,0.96);
  border-radius: var(--window-radius);
  box-shadow: 0 30px 80px rgba(0,0,0,0.4), 0 0 0 0.5px rgba(0,0,0,0.15);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: win-open 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes win-open { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.window.closing { animation: win-close 0.18s ease forwards; }
@keyframes win-close { to { opacity: 0; transform: scale(0.9); } }
.window.minimizing { animation: win-min 0.4s ease forwards; transform-origin: bottom center; }
@keyframes win-min { to { opacity: 0; transform: scale(0.2) translateY(400px); } }

.titlebar {
  height: 38px; flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 14px; gap: 8px;
  background: rgba(235,235,235,0.85);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
  cursor: grab;
}
.titlebar:active { cursor: grabbing; }
.traffic { display: flex; gap: 8px; align-items: center; }
.light {
  width: 12px; height: 12px; border-radius: 50%;
  cursor: pointer; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: rgba(0,0,0,0.5); font-weight: 700;
}
.light.close { background: #ff5f57; }
.light.min { background: #febc2e; }
.light.max { background: #28c840; }
.light span { opacity: 0; line-height: 1; }
.traffic:hover .light span { opacity: 1; }
.titlebar .win-title {
  flex: 1; text-align: center; font-size: 13px; font-weight: 600;
  color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-right: 52px;
}
.window-body { flex: 1; overflow: auto; position: relative; }

.resize-handle {
  position: absolute; width: 16px; height: 16px;
  right: 0; bottom: 0; cursor: nwse-resize; z-index: 10;
}

/* ===== Window content styles ===== */
.pane { display: flex; height: 100%; }
.sidebar {
  width: 180px; flex-shrink: 0; padding: 12px 8px;
  background: rgba(240,240,242,0.6);
  border-right: 0.5px solid rgba(0,0,0,0.08);
  font-size: 13px; overflow-y: auto;
}
.sidebar h4 { font-size: 11px; text-transform: uppercase; color: var(--text-dim); margin: 12px 8px 4px; letter-spacing: 0.04em; }
.sidebar .nav {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px; cursor: pointer; color: var(--text);
}
.sidebar .nav:hover { background: rgba(0,0,0,0.06); }
.sidebar .nav.active { background: var(--accent); color: #fff; }
.content { flex: 1; padding: 24px 28px; overflow-y: auto; line-height: 1.6; font-size: 14px; }
.content h1, .content h2, .notes h1, .notes h2, .proj-detail h2, .avatar { font-family: var(--font-display); }
.content h1 { font-size: 26px; margin-bottom: 4px; }
.content h2 { font-size: 18px; margin: 20px 0 8px; }
.content p { color: #333; margin-bottom: 12px; }
.content a { color: var(--accent); text-decoration: none; }
.content a:hover { text-decoration: underline; }
.tag {
  display: inline-block; padding: 3px 10px; margin: 3px 4px 3px 0;
  background: rgba(10,132,255,0.12); color: var(--accent);
  border-radius: 20px; font-size: 12px; font-weight: 500;
}

/* About profile */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.avatar {
  width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #7b4ba8, #f0915b);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700; color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.avatar.has-img { background-size: cover; background-position: center; color: transparent; font-size: 0; }

/* Rate card */
.rate-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.rate-seg {
  display: inline-flex; gap: 4px; padding: 4px;
  background: rgba(0,0,0,0.05); border-radius: 999px;
}
.rate-seg button {
  font: inherit; font-size: 12.5px; font-weight: 500; padding: 7px 15px;
  border: 0; border-radius: 999px; background: transparent; color: var(--text-dim);
  cursor: pointer; transition: background .15s, color .15s;
}
.rate-seg button:hover { color: var(--text); }
.rate-seg button.active { background: var(--accent); color: #fff; }
.rate-hint { font-size: 12.5px; color: var(--text-dim); }
.rate-hint b { color: var(--text); font-weight: 600; }

.rate-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px; margin-top: 20px; align-items: stretch;
}
.rate-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: 0.5px solid rgba(0,0,0,0.1); border-radius: 12px;
  padding: 20px 18px; box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.rate-card.featured { border: 1.5px solid var(--accent); box-shadow: 0 10px 28px rgba(0,0,0,0.12); }
.rate-flag {
  position: absolute; top: -9px; left: 18px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em;
}
.rate-card h3 { font-size: 16px; margin: 0; }
.rate-desc { font-size: 12.5px; color: var(--text-dim); margin: -4px 0 0; line-height: 1.45; }
.rate-price { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  padding-top: 10px; border-top: 0.5px solid rgba(0,0,0,0.08); }
.rate-from { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.rate-price b { font-size: 19px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.rate-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.rate-list li { position: relative; padding-left: 17px; font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.rate-list li::before {
  content: ""; position: absolute; left: 0; top: 0.48em; width: 7px; height: 7px;
  border-radius: 2px; background: var(--accent); opacity: 0.75;
}
.rate-meta {
  margin-top: auto; padding-top: 12px; border-top: 0.5px solid rgba(0,0,0,0.08);
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-dim);
}
.rate-meta b { color: var(--text); font-weight: 600; }

.rate-note {
  margin-top: 14px; padding: 13px 16px; border-radius: 10px;
  border: 1px dashed var(--accent); font-size: 13px; color: var(--text-dim); line-height: 1.5;
}
.rate-note b { color: var(--text); }

.rate-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 22px; }
.rate-lower h2 { font-size: 15px; margin: 0 0 10px; }
.rate-addon {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 0; border-top: 0.5px solid rgba(0,0,0,0.08); font-size: 13px;
}
.rate-addon:first-of-type { border-top: 0; }
.rate-addon b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate-terms { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; }
.rate-terms li { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }

/* Projects filter + search toolbar */
.proj-toolbar {
  display: flex; align-items: center;
  flex-wrap: nowrap; gap: 12px; margin-top: 18px;
}
.proj-search-wrap { position: relative; flex: 0 0 230px; }
.proj-search-ic {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  font-size: 15px; color: var(--text-dim); pointer-events: none;
}
.proj-search {
  width: 100%; box-sizing: border-box;
  padding: 8px 12px 8px 30px; font: inherit; font-size: 13px;
  background: rgba(0,0,0,0.05); border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 9px; color: var(--text); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.proj-search:focus {
  background: #fff; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,132,255,0.15);
}
.proj-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.proj-chips {
  display: flex; flex-wrap: nowrap; gap: 7px;
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 2px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.proj-chips::-webkit-scrollbar { display: none; }
.proj-chip { flex: 0 0 auto; }
.proj-chip {
  padding: 6px 13px; font: inherit; font-size: 12.5px; font-weight: 500;
  background: rgba(0,0,0,0.05); color: var(--text-dim);
  border: 0.5px solid transparent; border-radius: 20px;
  cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.1s;
}
.proj-chip:hover { background: rgba(0,0,0,0.09); color: var(--text); }
.proj-chip:active { transform: scale(0.96); }
.proj-chip.active { background: var(--accent); color: #fff; }
.proj-empty {
  grid-column: 1 / -1; padding: 40px 0; text-align: center;
  color: var(--text-dim); font-size: 14px;
}

/* Projects grid */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.proj-card {
  background: #fff; border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.proj-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,0.15); }
.proj-thumb { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 44px; color: #fff; }
.proj-info { padding: 12px 14px; }
.proj-info h3 { font-size: 15px; margin-bottom: 4px; }
.proj-info p { font-size: 12.5px; color: var(--text-dim); margin: 0; line-height: 1.45; }

/* Project detail page */
.proj-detail h2 { font-size: 16px; margin: 22px 0 8px; }
.proj-detail ul { margin: 0; }
.proj-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500; color: var(--accent);
  cursor: pointer; margin-bottom: 14px; user-select: none;
  padding: 4px 10px; border-radius: 6px; background: rgba(10,132,255,0.1);
  transition: background 0.15s;
}
.proj-back:hover { background: rgba(10,132,255,0.18); }
.proj-hero {
  height: 180px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 72px; color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}
.proj-meta {
  display: flex; flex-wrap: wrap; gap: 26px;
  margin: 18px 0 4px; padding: 14px 0;
  border-top: 0.5px solid rgba(0,0,0,0.1);
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
}
.pm-item { display: flex; flex-direction: column; gap: 2px; }
.pm-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }
.pm-v { font-size: 14px; font-weight: 600; }
.proj-highlights { margin-left: 18px; }
.proj-highlights li { margin-bottom: 6px; color: #333; }
.proj-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.proj-gallery > div {
  aspect-ratio: 4/3; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; color: #fff;
}
.proj-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.proj-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 20px;
  background: var(--accent); color: #fff !important;
  font-size: 13px; font-weight: 500; text-decoration: none !important;
  transition: filter 0.15s, transform 0.15s;
}
.proj-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* Skills bars */
.skill-row { margin-bottom: 14px; }
.skill-row .lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.skill-bar { height: 8px; background: rgba(0,0,0,0.08); border-radius: 4px; overflow: hidden; }
.skill-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), #5e5ce6); border-radius: 4px; transition: width 0.8s ease; }

/* Contact */
.contact-links { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.contact-links a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: #fff; border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 10px; font-size: 14px; color: var(--text); text-decoration: none;
  transition: background 0.15s;
}
.contact-links a:hover { background: rgba(10,132,255,0.08); }
.contact-links .ic { font-size: 22px; }

/* Terminal */
.terminal {
  background: #1a1a1e; color: #e6e6e6; height: 100%;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  padding: 14px; overflow-y: auto; line-height: 1.6;
}
.terminal .line { white-space: pre-wrap; word-break: break-word; }
.terminal .prompt-line { display: flex; gap: 8px; }
.terminal .ps1 { color: #28c840; flex-shrink: 0; }
.terminal .green { color: #28c840; }
.terminal .blue { color: #5ac8fa; }
.terminal .yellow { color: #ffd60a; }
.terminal .dim { color: #888; }
.terminal input {
  background: transparent; border: none; outline: none; color: #e6e6e6;
  font-family: inherit; font-size: inherit; flex: 1; caret-color: #28c840;
}

/* TextEdit / Notes */
.notes { padding: 28px 36px; font-size: 15px; line-height: 1.75; color: #222; }
.notes h1 { font-size: 24px; margin-bottom: 12px; }
.notes ul { margin: 8px 0 16px 22px; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 16px; }
.photo-grid > div {
  aspect-ratio: 1; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; cursor: pointer; transition: transform 0.15s;
}
.photo-grid > div:hover { transform: scale(1.04); }

/* ===== Dock ===== */
#dock {
  position: fixed; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 6px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.22);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 0.5px solid rgba(255,255,255,0.35);
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  z-index: 4000;
}
.dock-item {
  position: relative; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; cursor: pointer;
  border-radius: 14px;
  transition: transform 0.18s cubic-bezier(0.2,0.9,0.3,1.4), margin 0.18s;
  transform-origin: bottom center;
}
.dock-item:hover { transform: scale(1.35) translateY(-8px); }
.dock-item .tip {
  position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%) scale(0);
  background: rgba(40,40,40,0.92); color: #fff; font-size: 12px;
  padding: 4px 10px; border-radius: 6px; white-space: nowrap;
  transition: transform 0.12s; pointer-events: none;
  font-family: 'Inter', sans-serif;
}
.dock-item:hover .tip { transform: translateX(-50%) scale(1); }
.dock-item .dot {
  position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: rgba(0,0,0,0.55);
  opacity: 0; transition: opacity 0.15s;
}
.dock-item.running .dot { opacity: 1; }
.dock-sep { width: 1px; height: 44px; background: rgba(255,255,255,0.35); margin: 0 4px; align-self: center; }
.dock-item.bounce { animation: bounce 0.6s ease; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-22px); } 60% { transform: translateY(-6px); } }

/* Control center */
#cc-panel {
  position: fixed; top: 32px; right: 8px;
  width: 320px; padding: 14px;
  background: rgba(245,245,245,0.65);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 0.5px solid rgba(255,255,255,0.5);
  border-radius: 16px; box-shadow: 0 16px 50px rgba(0,0,0,0.3);
  z-index: 6000; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  animation: drop-in 0.15s ease;
}
.cc-tile {
  background: rgba(255,255,255,0.55); border-radius: 12px; padding: 12px;
  font-size: 12px; color: var(--text);
}
.cc-tile.wide { grid-column: span 2; }
.cc-tile .t { font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.cc-slider { width: 100%; accent-color: var(--accent); }
.cc-np-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-np-info { min-width: 0; }
.cc-np-title { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-np-artist { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-np-ctrl { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.cc-np-ctrl button {
  border: none; background: rgba(0,0,0,0.06); cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%; font-size: 12px; color: var(--text);
  display: flex; align-items: center; justify-content: center; transition: background 0.12s;
}
.cc-np-ctrl button:hover { background: rgba(0,0,0,0.14); }
.cc-np-ctrl #cc-play { background: var(--accent); color: #fff; }
.cc-np-ctrl #cc-play:hover { filter: brightness(1.08); }

/* ===== Menu-bar status icons (modern macOS look) ===== */
.mi-icon { display: inline-flex; align-items: center; gap: 4px; }
.mi-svg { height: 14px; width: auto; display: block; }
.mi-icon small { font-size: 11px; font-weight: 500; }

/* sidebar nav icon wrapper */
.nav-ic { display: inline-flex; align-items: center; justify-content: center; width: 18px; }
.nav-ic .emoji { font-size: 15px; line-height: 1; }

/* custom image app icons */
.dock-item .app-icon-img { width: 46px; height: 46px; object-fit: contain; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35)); }
.desktop-icon .glyph .app-icon-img { width: 50px; height: 50px; object-fit: contain; display: block; }
.nav-ic .app-icon-img { width: 18px; height: 18px; object-fit: contain; display: block; }
.cc-icon-img { width: 17px; height: 17px; object-fit: contain; display: inline-block; vertical-align: middle; }

/* ===== Music app ===== */
.music { display: flex; flex-direction: column; height: 100%; background: #fff; }
.np { padding: 22px 22px 16px; text-align: center; border-bottom: 0.5px solid rgba(0,0,0,0.08); }
.np-art {
  width: 168px; height: 168px; margin: 0 auto 16px; border-radius: 14px;
  background: linear-gradient(135deg, #7b4ba8, #f0915b);
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.22);
  background-size: cover; background-position: center;
}
.np-title { font-size: 17px; font-weight: 700; }
.np-artist { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.mu-seek { height: 6px; background: rgba(0,0,0,0.1); border-radius: 3px; margin: 16px 0 6px; cursor: pointer; overflow: hidden; }
.mu-seek-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.mu-time { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); }
.mu-controls { display: flex; align-items: center; justify-content: center; gap: 26px; margin-top: 16px; }
.mu-controls button { border: none; background: none; cursor: pointer; font-size: 20px; color: var(--text); }
.mu-play {
  width: 50px; height: 50px; border-radius: 50% !important;
  background: var(--accent) !important; color: #fff !important;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px !important; box-shadow: 0 4px 14px rgba(10,132,255,0.45);
}
.mu-play:hover { filter: brightness(1.08); }
.mu-list { flex: 1; overflow-y: auto; padding: 8px; }
.mu-track { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.mu-track:hover { background: rgba(0,0,0,0.05); }
.mu-track.active { background: rgba(10,132,255,0.12); }
.mu-tnum { width: 18px; text-align: center; font-size: 12px; color: var(--text-dim); }
.mu-track.active .mu-tnum { color: var(--accent); }
.mu-tt { font-size: 13px; font-weight: 600; }
.mu-ta { font-size: 11px; color: var(--text-dim); }
.mu-tdur { margin-left: auto; font-size: 11px; color: var(--text-dim); }

/* mobile */
@media (max-width: 640px) {
  .window { min-width: 0 !important; }
  #desktop-icons { top: 40px; right: 8px; }
  .sidebar { width: 130px; }
  .dock-item { width: 40px; height: 40px; font-size: 26px; }
}

/* ===================================================================
   Visual editor  (the "Edit" panel for non-coders)
   =================================================================== */
#edit-toggle {
  background: rgba(255,255,255,0.22);
  border: 0.5px solid rgba(255,255,255,0.3);
  font-weight: 600;
}
#edit-toggle.active { background: var(--accent); }

.editor {
  position: fixed; top: var(--menubar-h); right: 0; bottom: 0;
  width: 380px; max-width: 92vw; z-index: 8000;
  background: rgba(248,248,250,0.92);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-left: 0.5px solid rgba(0,0,0,0.12);
  box-shadow: -12px 0 50px rgba(0,0,0,0.25);
  display: flex; flex-direction: column;
  font-family: var(--font-ui);
  animation: ed-slide 0.25s cubic-bezier(0.2,0.9,0.3,1);
}
@keyframes ed-slide { from { transform: translateX(100%); } to { transform: none; } }

.ed-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; flex-shrink: 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
}
.ed-title { font-size: 16px; font-weight: 700; }
.ed-close {
  border: none; background: rgba(0,0,0,0.08); cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%; font-size: 13px; color: #333;
}
.ed-close:hover { background: rgba(0,0,0,0.16); }

.ed-tabs {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 12px; flex-shrink: 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.1);
}
.ed-tab {
  border: none; background: transparent; cursor: pointer;
  padding: 5px 11px; border-radius: 16px; font-size: 12.5px; color: var(--text-dim);
  font-family: inherit;
}
.ed-tab:hover { background: rgba(0,0,0,0.06); }
.ed-tab.active { background: var(--accent); color: #fff; font-weight: 600; }

.ed-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.ed-pane { display: flex; flex-direction: column; gap: 12px; }

.ed-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim); font-weight: 700; margin-top: 8px; }
.ed-hint { font-size: 12px; color: var(--text-dim); line-height: 1.45; }

.ed-field { display: flex; flex-direction: column; gap: 5px; }
.ed-label { font-size: 12.5px; font-weight: 500; color: #333; }
.ed-input {
  width: 100%; padding: 8px 10px; font-size: 13px;
  border: 1px solid rgba(0,0,0,0.15); border-radius: 8px;
  background: #fff; font-family: inherit; color: var(--text);
  outline: none; transition: border 0.15s;
}
.ed-input:focus { border-color: var(--accent); }
.ed-textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.ed-color { width: 44px; height: 32px; padding: 2px; border: 1px solid rgba(0,0,0,0.15); border-radius: 8px; cursor: pointer; background: #fff; }

.ed-btn {
  border: 1px solid rgba(0,0,0,0.15); background: #fff; cursor: pointer;
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-family: inherit;
  color: var(--text); transition: background 0.15s;
}
.ed-btn:hover { background: rgba(0,0,0,0.05); }
.ed-block { width: 100%; }
.ed-primary { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
.ed-primary:hover { filter: brightness(1.08); background: var(--accent); }
.ed-btn-sm {
  border: 1px solid rgba(0,0,0,0.15); background: #fff; cursor: pointer;
  padding: 3px 8px; border-radius: 6px; font-size: 12px; font-family: inherit; color: var(--text);
}
.ed-btn-sm:hover { background: rgba(0,0,0,0.06); }
.ed-danger { color: #ff3b30; border-color: rgba(255,59,48,0.3); }
.ed-danger:hover { background: rgba(255,59,48,0.08); }

.ed-list { display: flex; flex-direction: column; gap: 8px; }
.ed-row { display: flex; gap: 6px; align-items: flex-start; }
.ed-row .ed-input { flex: 1; }

.ed-card { border: 1px solid rgba(0,0,0,0.12); border-radius: 10px; background: rgba(255,255,255,0.6); overflow: hidden; }
.ed-card > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; cursor: pointer; font-size: 13px; font-weight: 600; list-style: none;
}
.ed-card > summary::-webkit-details-marker { display: none; }
.ed-card > summary:hover { background: rgba(0,0,0,0.04); }
.ed-card-ctrl { display: flex; gap: 4px; }
.ed-card-body { padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 11px; border-top: 0.5px solid rgba(0,0,0,0.08); }

.ed-img { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-img-prev {
  width: 64px; height: 48px; border-radius: 8px; flex-shrink: 0;
  background: rgba(0,0,0,0.08); display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-dim); text-align: center;
}
.ed-img input[type=file] { font-size: 11px; max-width: 150px; }

.ed-range { display: flex; align-items: center; gap: 10px; }
.ed-range input[type=range] { flex: 1; accent-color: var(--accent); }
.ed-range .val { font-size: 12px; color: var(--text-dim); width: 34px; text-align: right; }

.ed-foot {
  display: flex; gap: 8px; padding: 12px 16px; flex-shrink: 0;
  border-top: 0.5px solid rgba(0,0,0,0.1);
}
.ed-foot .ed-primary { flex: 1; }

/* Toast */
#toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(40,40,40,0.95); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; z-index: 99999; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; max-width: 80vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 640px) {
  .editor { width: 100%; }
}

/* ===================================================================
   Photos → gallery (masonry) + shared lightbox
   =================================================================== */
.gallery { columns: 3 150px; column-gap: 10px; padding: 14px; }
.ph-cell {
  break-inside: avoid; margin: 0 0 10px; border-radius: 10px; overflow: hidden;
  cursor: zoom-in; position: relative; box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ph-cell:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.2); }
.ph-cell img { width: 100%; display: block; }
.ph-block { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 46px; color: #fff; }
.ph-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 10px 8px;
  font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.65));
  opacity: 0; transition: opacity 0.15s;
}
.ph-cell:hover .ph-cap { opacity: 1; }

#lightbox {
  position: fixed; inset: 0; z-index: 99990;
  background: rgba(0,0,0,0.88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; animation: drop-in 0.15s ease;
}
.lb-stage { max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-stage img { max-width: 92vw; max-height: 80vh; border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); }
.lb-block { width: min(70vw, 420px); aspect-ratio: 1; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 130px; color: #fff; }
.lb-cap { color: #fff; font-size: 14px; text-align: center; max-width: 80vw; }
.lb-close, .lb-nav {
  position: fixed; border: none; background: rgba(255,255,255,0.16); color: #fff;
  cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,0.3); }
.lb-close { top: 18px; right: 20px; width: 40px; height: 40px; font-size: 17px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 50px; height: 50px; font-size: 30px; line-height: 1; }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-count { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.85); font-size: 13px; }

/* ===================================================================
   Project cards (redesigned) + content blocks
   =================================================================== */
.proj-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.proj-card { border: none; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.proj-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px rgba(0,0,0,0.18); }
.proj-thumb { height: 150px; position: relative; }
.proj-thumb-emoji { font-size: 46px; }
.proj-view {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 11px; font-weight: 600;
  padding: 4px 11px; border-radius: 14px; opacity: 0; transform: translateY(5px);
  transition: opacity 0.16s, transform 0.16s; backdrop-filter: blur(4px);
}
.proj-card:hover .proj-view { opacity: 1; transform: none; }
.proj-tags { margin-top: 10px; }

.proj-blocks { margin-top: 8px; }
.proj-blocks > p { color: #333; margin: 0 0 12px; }
.proj-blocks h2 { font-size: 16px; margin: 24px 0 8px; }
.proj-figure {
  margin: 18px 0; cursor: zoom-in; border-radius: 12px; overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12); transition: transform 0.15s, box-shadow 0.15s;
}
.proj-figure:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0,0,0,0.2); }
.proj-figure img { width: 100%; display: block; }
.proj-figure figcaption { font-size: 12.5px; color: var(--text-dim); padding: 8px 14px; background: #fff; }
.proj-hero[onclick] { cursor: zoom-in; }

/* ===================================================================
   Project detail — showcase polish (uncropped hero, readable layout)
   =================================================================== */
.proj-hero-stage {
  border-radius: 16px; overflow: hidden; cursor: zoom-in;
  background: linear-gradient(135deg, #eef0f4, #e2e5ec);
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; max-height: 66vh;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.proj-hero-stage img { max-width: 100%; max-height: 66vh; width: auto; height: auto; display: block; }

/* readable measure for text; let images breathe full-width */
.proj-detail .proj-blocks > p,
.proj-detail .proj-blocks h2,
.proj-detail .proj-blocks ul { max-width: 720px; }
.proj-detail h1 { font-size: 30px; letter-spacing: -0.01em; }
.proj-figure { margin: 22px 0; }
.proj-figure img { background: #f4f5f7; }

/* ===================================================================
   Showcase v2 — fill hero, image-led cards, 2-up galleries, fade-in
   =================================================================== */
/* Hero fills the full width (no letterbox gaps), still uncropped */
.proj-hero-stage { min-height: 0; max-height: none; background: transparent; box-shadow: none; display: block; }
.proj-hero-stage img { width: 100%; height: auto; max-width: none; max-height: none; }

/* Image-led project cards */
.proj-thumb { height: 190px; }
.proj-info { padding: 14px 16px; }
.proj-info h3 { font-size: 16px; }
.proj-info p {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Two-up image group */
.proj-gallery2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 20px 0; }
.proj-gallery2 .proj-gcell {
  margin: 0; cursor: zoom-in; border-radius: 12px; overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12); transition: transform 0.15s, box-shadow 0.15s;
}
.proj-gallery2 .proj-gcell:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0,0,0,0.2); }
.proj-gallery2 .proj-gcell img { width: 100%; display: block; background: #f4f5f7; }
.proj-gallery2 figcaption { font-size: 12px; color: var(--text-dim); padding: 8px 12px; background: #fff; }

/* Smooth fade-in for images */
.proj-hero-stage img, .proj-figure img, .proj-gallery2 img, .ph-cell img { animation: imgfade 0.45s ease both; }
@keyframes imgfade { from { opacity: 0; } to { opacity: 1; } }

/* ===================================================================
   Dark mode  (html.dark — toggled from the menu bar)
   =================================================================== */
html.dark { --text: #f2f2f5; --text-dim: #9b9ba1; }

/* Windows & chrome */
html.dark .window { background: #26262b; box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 0.5px rgba(255,255,255,0.08); }
html.dark .titlebar { background: rgba(48,48,54,0.9); border-bottom-color: rgba(255,255,255,0.08); }
html.dark .titlebar .win-title { color: #d4d4d9; }
html.dark .window-body { background: #1d1d21; }
html.dark .resize-handle { filter: invert(1) opacity(0.4); }

/* Text surfaces */
html.dark .content p, html.dark .proj-highlights li { color: #c7c7cc; }
html.dark .notes { color: #c7c7cc; }

/* Finder-style sidebar */
html.dark .sidebar { background: rgba(34,34,39,0.7); border-right-color: rgba(255,255,255,0.07); }
html.dark .sidebar .nav { color: #e5e5ea; }
html.dark .sidebar .nav:hover { background: rgba(255,255,255,0.08); }

/* Project cards & case study */
html.dark .proj-card { background: #2a2a30; box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
html.dark .proj-card:hover { box-shadow: 0 18px 40px rgba(0,0,0,0.6); }
html.dark .proj-search { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
html.dark .proj-search:focus { background: #1f1f24; box-shadow: 0 0 0 3px rgba(10,132,255,0.25); }
html.dark .proj-chip { background: rgba(255,255,255,0.08); color: #c7c7cc; }
html.dark .proj-chip:hover { background: rgba(255,255,255,0.14); color: #fff; }
html.dark .proj-chip.active { background: var(--accent); color: #fff; }
html.dark .rate-card { background: #2a2a30; border-color: rgba(255,255,255,0.1); box-shadow: 0 4px 16px rgba(0,0,0,0.5); }
html.dark .rate-card.featured { border-color: var(--accent); box-shadow: 0 10px 28px rgba(0,0,0,0.6); }
html.dark .rate-seg { background: rgba(255,255,255,0.08); }
html.dark .rate-seg button { color: #c7c7cc; }
html.dark .rate-seg button:hover { color: #fff; }
html.dark .rate-price, html.dark .rate-meta, html.dark .rate-addon { border-color: rgba(255,255,255,0.12); }
html.dark .rate-desc, html.dark .rate-list li, html.dark .rate-terms li, html.dark .rate-hint { color: #a6a69c; }
html.dark .proj-figure { box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
html.dark .proj-figure figcaption, html.dark .proj-gallery2 figcaption { background: #26262b; }
html.dark .proj-meta { border-color: rgba(255,255,255,0.12); }

/* Contact */
html.dark .contact-links a { background: #2a2a30; border-color: rgba(255,255,255,0.1); color: var(--text); }
html.dark .contact-links a:hover { background: rgba(10,132,255,0.22); }

/* Skills */
html.dark .skill-bar { background: rgba(255,255,255,0.12); }

/* Music */
html.dark .music { background: #1d1d21; }
html.dark .np { border-bottom-color: rgba(255,255,255,0.08); }
html.dark .mu-seek { background: rgba(255,255,255,0.14); }
html.dark .mu-track:hover { background: rgba(255,255,255,0.07); }
html.dark .mu-track.active { background: rgba(10,132,255,0.22); }

/* Menus & popovers */
html.dark .dropdown { background: rgba(40,40,46,0.9); border-color: rgba(255,255,255,0.12); color: var(--text); }
html.dark #cc-panel { background: rgba(38,38,44,0.8); border-color: rgba(255,255,255,0.12); }
html.dark .cc-tile { background: rgba(255,255,255,0.08); }
html.dark .cc-np-ctrl button { background: rgba(255,255,255,0.12); color: var(--text); }

/* Editor panel */
html.dark .editor { background: rgba(26,26,30,0.95); border-left-color: rgba(255,255,255,0.1); }
html.dark .ed-head, html.dark .ed-tabs, html.dark .ed-foot { border-color: rgba(255,255,255,0.1); }
html.dark .ed-label { color: #c2c2c8; }
html.dark .ed-input { background: #2a2a30; border-color: rgba(255,255,255,0.16); color: var(--text); }
html.dark .ed-btn, html.dark .ed-btn-sm { background: #2f2f36; border-color: rgba(255,255,255,0.16); color: var(--text); }
html.dark .ed-btn:hover, html.dark .ed-btn-sm:hover { background: #3a3a42; }
html.dark .ed-card, html.dark .ed-card-body { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12) !important; }
html.dark .ed-tab:hover { background: rgba(255,255,255,0.08); }
html.dark .ed-close { background: rgba(255,255,255,0.14); color: #fff; }
html.dark .ed-img-prev { background: rgba(255,255,255,0.1); }

/* Slightly dim the wallpaper so windows pop */
html.dark #desktop::after {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.28); pointer-events: none;
}

/* Two-up gallery: size each cell to its own image (no stretch white gap) */
.proj-gallery2 { align-items: start; }
.proj-gallery2 .proj-gcell { align-self: start; }

/* ===== Autoplaying video block (reels) — small preview, click to expand ===== */
.proj-video { position: relative; background:#000; border-radius:12px; overflow:hidden; cursor:zoom-in; width: fit-content; max-width:100%; margin: 22px auto; }
.proj-video video { max-height: 420px; max-width: 100%; display:block; }
.proj-video .vid-play { position:absolute; top: calc(50% - 27px); left:0; right:0; margin:0 auto; width:54px; height:54px; border-radius:50%; background:rgba(0,0,0,0.45); color:#fff; display:flex; align-items:center; justify-content:center; font-size:18px; padding-left:3px; pointer-events:none; transition:background .15s, transform .15s; }
.proj-video:hover .vid-play { background:rgba(0,0,0,0.65); transform:scale(1.08); }
.proj-video figcaption { background:#fff; }
/* video inside the lightbox media player */
.lb-video { max-height:86vh; max-width:92vw; border-radius:8px; background:#000; box-shadow:0 24px 70px rgba(0,0,0,0.6); display:block; }
html.dark .proj-video figcaption { background:#26262b; }

/* ===== Resize handles (all corners + edges) ===== */
.rz { position:absolute; z-index:11; }
.rz-n { top:0; left:10px; right:10px; height:6px; cursor:ns-resize; }
.rz-s { bottom:0; left:10px; right:10px; height:6px; cursor:ns-resize; }
.rz-e { right:0; top:10px; bottom:10px; width:6px; cursor:ew-resize; }
.rz-w { left:0; top:10px; bottom:10px; width:6px; cursor:ew-resize; }
.rz-ne,.rz-nw,.rz-se,.rz-sw { width:16px; height:16px; z-index:12; }
.rz-ne { top:0; right:0; cursor:nesw-resize; }
.rz-nw { top:0; left:0; cursor:nwse-resize; }
.rz-se { bottom:0; right:0; cursor:nwse-resize; }
.rz-sw { bottom:0; left:0; cursor:nesw-resize; }

/* ===================================================================
   Mobile mode (phones / narrow screens)
   =================================================================== */
@media (max-width: 700px) {
  /* simpler menu bar */
  #menubar .menu-left .menu-item:not(.menu-logo):not(.menu-bold) { display:none; }
  #menu-date, .menu-right .mi-icon[title^="Battery"], .menu-right .mi-icon[title^="Wi-Fi"], #menu-search { display:none; }
  #desktop-icons { display:none; }

  /* windows open full-screen */
  .window {
    left:0 !important; top: var(--menubar-h) !important;
    width:100vw !important; height: calc(100vh - var(--menubar-h) - 66px) !important;
    min-width:0; border-radius:0; box-shadow:none;
    background:#fafafa; /* opaque on mobile: full-screen, no wallpaper benefit, kills ghosting */
  }
  html.dark .window { background:#26262b; }
  .rz { display:none !important; }
  .titlebar { cursor:default; }
  .titlebar .win-title { margin-right:0; }

  /* dock = bottom app bar */
  #dock {
    left:0; right:0; bottom:0; transform:none; width:100%;
    border-radius:16px 16px 0 0; justify-content:flex-start;
    overflow-x:auto; -webkit-overflow-scrolling:touch; gap:6px; padding:8px 10px;
  }
  .dock-item { width:46px; height:46px; font-size:30px; flex:0 0 auto; }
  .dock-item:hover { transform:none !important; }
  .dock-item .app-icon-img { width:40px; height:40px; }
  .dock-item .tip { display:none; }

  /* content */
  .content { padding:18px 16px; }
  .content h1 { font-size:22px; }
  .sidebar { width:118px; padding:10px 6px; }
  .proj-toolbar { flex-direction:column; align-items:stretch; }
  .proj-search-wrap { flex:1 1 auto; }
  .proj-chips { overflow-x:auto; flex-wrap:nowrap; -webkit-overflow-scrolling:touch; padding-bottom:2px; }
  .proj-chip { flex:0 0 auto; }
  .proj-grid { grid-template-columns:1fr; }
  .rate-grid { grid-template-columns:1fr; }
  .rate-lower { grid-template-columns:1fr; gap:20px; }
  .proj-detail h1 { font-size:24px; }
  .gallery { columns:2 120px; }
  .notes { padding:20px 18px; }
  .np-art { width:140px; height:140px; }

  /* control center fits */
  #cc-panel { right:8px; left:8px; width:auto; }
}
