﻿:root {
  --lime: #b4f155;
  --lime-rgb: 180, 241, 85;
  --lime-dim: #93cc3f;
  --lime-deep: #79a832;
  --black: #0a0a0a;
  --near-black: #131313;
  --surface: rgba(28, 28, 30, 0.72);
  --surface-solid: #1c1c1e;
  --icon-surface: linear-gradient(160deg, #202022 0%, #0c0c0d 100%);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f5f5f2;
  --text-dim: #a6a6a1;

  --font-display: 'Coolvetica', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;

  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
}

@font-face {
  font-family: 'Coolvetica';
  src: url('../assets/fonts/CoolveticaHvComp.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Coolvetica';
  src: url('../assets/fonts/CoolveticaRgIt.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-system);
  color: var(--text);
  background: var(--black);
  user-select: none;
  -webkit-user-select: none;
}

input, textarea, [contenteditable] {
  user-select: text;
  -webkit-user-select: text;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* film grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(var(--lime-rgb), 0.14) 0%, rgba(var(--lime-rgb), 0.05) 40%, transparent 72%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
.cursor-glow.active { opacity: 1; }

/* ===== Menu bar ===== */
.menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  z-index: 500;
  font-size: 13px;
}
.menubar-left, .menubar-right { display: flex; align-items: center; gap: 6px; }
.menubar-logo { display: inline-flex; align-items: center; margin-right: 10px; }
.menubar-logo img { height: 15px; width: auto; display: block; filter: drop-shadow(0 0 3px rgba(var(--lime-rgb), 0.5)); }
.menubar-item { color: var(--text-dim); letter-spacing: 0.2px; }
.menubar-item.strong { color: var(--text); font-weight: 600; margin-right: 14px; }

.menubar-menu { position: relative; }
.menubar-btn {
  background: none;
  border: none;
  font: inherit;
  color: var(--text-dim);
  letter-spacing: 0.2px;
  padding: 4px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s var(--ease-out), color 0.12s var(--ease-out);
}
.menubar-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.menubar-menu.open .menubar-btn { background: var(--lime); color: #0a0a0a; }

.menubar-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 190px;
  background: rgba(24, 24, 24, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 5px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-out);
  z-index: 600;
}
.menubar-menu.open .menubar-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menubar-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font-system);
  font-size: 12.5px;
  color: var(--text);
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.menubar-dropdown-item:hover { background: rgba(var(--lime-rgb), 0.18); color: var(--lime); }
.menubar-dropdown-item.disabled { color: var(--text-dim); cursor: default; }
.menubar-dropdown-item.disabled:hover { background: none; color: var(--text-dim); }

.menubar-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  line-height: 0;
  transition: color 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .menubar-bell:hover { color: var(--lime); transform: scale(1.1); }
}
.bell-dot {
  position: absolute;
  top: -1px; right: -1px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 6px rgba(var(--lime-rgb), 0.85);
  display: none;
}
.bell-dot.active { display: block; }

/* ===== Notification toast ===== */
.notification-toast {
  position: fixed;
  top: 40px;
  right: 16px;
  width: 320px;
  max-width: calc(100vw - 32px);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  background: rgba(18, 18, 18, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
  cursor: pointer;
  z-index: 900;
  transform: translateY(-18px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}
.notification-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
@media (hover: hover) and (pointer: fine) {
  .notification-toast:hover { border-color: rgba(var(--lime-rgb), 0.4); }
}
.toast-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}
.toast-icon .icon-glyph { width: 36px; height: 36px; border-radius: 10px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 3px;
}
.toast-message {
  font-size: 12.5px;
  color: rgba(255,255,255,0.72);
  line-height: 1.4;
}
.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex: 0 0 auto;
}
@media (hover: hover) and (pointer: fine) {
  .toast-close:hover { color: var(--lime); }
}

@media (max-width: 760px) {
  .notification-toast { top: 56px; right: 8px; left: 8px; width: auto; max-width: none; }
}

/* ===== Desktop ===== */
.desktop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  padding-top: 28px;
  background: linear-gradient(180deg, #0d0d0d 0%, #060606 55%, #000000 100%);
  overflow: hidden;
}

/* ===== Aurora background ===== */
.aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  mix-blend-mode: screen;
  opacity: 0.42;
  will-change: transform;
}
.blob1 {
  width: 520px; height: 520px;
  top: -160px; left: 6%;
  background: radial-gradient(circle, rgba(180,241,85,0.55), transparent 70%);
  animation: auroraDrift1 44s ease-in-out infinite;
}
.blob2 {
  width: 460px; height: 460px;
  bottom: -140px; right: 4%;
  background: radial-gradient(circle, rgba(122,158,38,0.5), transparent 70%);
  animation: auroraDrift2 56s ease-in-out infinite;
}
.blob3 {
  width: 420px; height: 420px;
  top: 38%; left: 56%;
  background: radial-gradient(circle, rgba(230,255,180,0.4), transparent 70%);
  animation: auroraDrift3 50s ease-in-out infinite;
}

/* continuous loops: each returns to its start pose, so nothing ever pops or fades out */
@keyframes auroraDrift1 {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(120px, 70px) scale(1.10); }
  50%  { transform: translate(60px, 150px) scale(1.02); }
  75%  { transform: translate(-70px, 60px) scale(1.12); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes auroraDrift2 {
  0%   { transform: translate(0, 0) scale(1.05); }
  25%  { transform: translate(-130px, -80px) scale(1.14); }
  50%  { transform: translate(-40px, -170px) scale(1.02); }
  75%  { transform: translate(90px, -60px) scale(1.10); }
  100% { transform: translate(0, 0) scale(1.05); }
}
@keyframes auroraDrift3 {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(-110px, 90px) scale(1.12); }
  50%  { transform: translate(80px, 130px) scale(1.04); }
  75%  { transform: translate(130px, -70px) scale(1.09); }
  100% { transform: translate(0, 0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-blob { animation: none; }
}

.brand-lockup {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  user-select: none;
  pointer-events: none;
}
.brand-logo-img {
  display: block;
  margin: 0 auto;
  width: clamp(260px, 32vw, 500px);
  height: auto;
  filter: drop-shadow(0 0 50px rgba(var(--lime-rgb), 0.45));
}
/* ===== Desktop icons ===== */
.desktop-icons-wrap { display: contents; }
.desktop-icon {
  position: absolute;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 8px;
  transition: background 0.15s var(--ease-out);
}
.desktop-icon:hover, .desktop-icon:focus-visible {
  background: rgba(var(--lime-rgb), 0.10);
  outline: none;
}
.desktop-icon.icon-dragging {
  cursor: grabbing;
  z-index: 50;
  background: rgba(var(--lime-rgb), 0.16);
  transition: none;
}
.desktop-icon { cursor: grab; }
.desktop-icon .icon-label {
  font-size: 12px;
  color: var(--text);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  line-height: 1.25;
}
.desktop-icon.selected {
  background: rgba(var(--lime-rgb), 0.22);
}
.desktop-icon.selected .icon-label {
  background: rgba(var(--lime-rgb), 0.45);
  color: #0a0a0a;
  border-radius: 3px;
  padding: 1px 5px;
  text-shadow: none;
}

.selection-box {
  position: absolute;
  left: 0; top: 0; width: 0; height: 0;
  border: 1px solid rgba(var(--lime-rgb), 0.85);
  background: rgba(var(--lime-rgb), 0.14);
  border-radius: 2px;
  display: none;
  pointer-events: none;
  z-index: 40;
}
.selection-box.active { display: block; }

.icon-glyph {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: block;
  background: var(--icon-surface);
  border: 1px solid rgba(var(--lime-rgb), 0.22);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  position: relative;
}

/* real icon artwork: full-color SVGs, not masked glyphs */
.icon-real {
  background: none;
  border: none;
  box-shadow: none;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.55));
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* ===== Windows ===== */
.window {
  position: absolute;
  top: 10%;
  left: 50%;
  width: min(860px, 88vw);
  max-height: 82vh;
  min-width: 320px;
  min-height: 200px;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 0 rgba(var(--lime-rgb), 0);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;

  opacity: 0;
  transform: translate(-50%, 0) scale(0.85);
  pointer-events: none;
  transition: opacity 0.32s var(--ease-out), transform 0.32s var(--ease-pop), box-shadow 0.35s var(--ease-out), rotate 0.4s var(--ease-out);
}
/* 3D tilt: the independent CSS `rotate` property (not the `transform`
   property) — it composes with .window's own transform automatically and
   can never conflict with the translate/scale that open/close, drag, and
   maximize already drive through `transform`. This also means .window stays
   ONE element (its normal border/blur/background), so there's no second
   backdrop-filter layer to introduce a seam at rest like the previous
   two-layer version did. */
.window.dragging { rotate: none !important; transition: none; }
.window.tilt-glow {
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 70px 8px rgba(var(--lime-rgb), 0.22);
}
.window.open {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}
.window.closing {
  opacity: 0;
  transform: translate(-50%, 0) scale(0.88);
  transition: opacity 0.16s var(--ease-in), transform 0.16s var(--ease-in);
}
.window.front { z-index: 200; }

.window-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 20;
}
.window-resize-handle::before {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.25);
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 0 0 3px 0;
}
.window-resize-handle:hover::before { border-color: var(--lime); }

.window-titlebar {
  height: 38px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
}
.window-titlebar:active { cursor: grabbing; }
.traffic { display: flex; gap: 8px; margin-right: 12px; }
.dot { width: 12px; height: 12px; border-radius: 50%; padding: 0; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }
.window-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-right: 60px;
}

.window-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 24px;
  font-family: var(--font-body);
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  scrollbar-width: thin;
}
.window-body::-webkit-scrollbar { width: 8px; }
.window-body::-webkit-scrollbar-track { background: transparent; }
.window-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
.window-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }


/* Finder window */
.finder-body { padding: 0; display: flex; height: 420px; }
.finder-body.single { height: 220px; }
.finder-sidebar {
  width: 150px; flex: 0 0 auto;
  background: rgba(255,255,255,0.02);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  font-size: 12px;
}
.finder-section { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; font-size: 10px; margin-bottom: 8px; padding: 0 6px; }
.finder-row {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text-dim);
  margin-bottom: 2px;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .finder-row:hover { background: rgba(255, 255, 255, 0.05); }
}
.finder-row.active { background: rgba(var(--lime-rgb), 0.15); }
.finder-row.active .finder-row-text {
  background: linear-gradient(90deg, var(--lime), #eaffb0, #6f9e1c, var(--lime), #eaffb0);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: bestWorkGradient 5s linear infinite;
}
@keyframes bestWorkGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .finder-row.active .finder-row-text { animation: none; background-position: 0% 50%; }
}
.finder-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.finder-toolbar {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--text-dim);
  padding: 10px 16px; border-bottom: 1px solid var(--border); letter-spacing: 0.3px;
}
.finder-toolbar[hidden] { display: none; }
.finder-back {
  flex: 0 0 auto;
  color: var(--lime);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px 3px 4px;
  border-radius: 5px;
}
@media (hover: hover) and (pointer: fine) {
  .finder-back:hover { background: rgba(var(--lime-rgb), 0.12); }
}
.finder-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finder-empty { margin: auto; color: var(--text-dim); font-size: 13px; }

/* Minesweeper easter egg (Trash bin) */
.finder-body.game-open { height: 560px; }
.finder-body.game-open .finder-main {
  overflow-y: auto; align-items: stretch; justify-content: flex-start; padding: 16px;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  scrollbar-width: thin;
}
.finder-body.game-open .finder-main::-webkit-scrollbar { width: 8px; }
.finder-body.game-open .finder-main::-webkit-scrollbar-track { background: transparent; }
.finder-body.game-open .finder-main::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
.finder-body.game-open .finder-main::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.minesweeper { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.minesweeper[hidden] { display: none; }
.ms-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ms-diff { display: flex; gap: 6px; }
.ms-diff-btn {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  cursor: pointer;
}
.ms-diff-btn.active { background: rgba(var(--lime-rgb), 0.15); color: var(--lime); border-color: rgba(var(--lime-rgb), 0.4); }
.ms-stats { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.ms-reset {
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  line-height: 1;
}
.ms-board {
  display: grid;
  gap: 2px;
  align-self: center;
  background: rgba(0,0,0,0.3);
  padding: 6px;
  border-radius: 8px;
}
.ms-cell {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.ms-board-large .ms-cell { width: 22px; height: 22px; font-size: 11px; }
@media (hover: hover) and (pointer: fine) {
  .ms-cell:not(.ms-revealed):not(.ms-flagged):hover { background: rgba(255,255,255,0.14); }
}
.ms-cell.ms-revealed { background: rgba(255,255,255,0.03); cursor: default; }
.ms-cell.ms-flagged { background: rgba(var(--lime-rgb), 0.12); }
.ms-cell.ms-mine { background: rgba(220,60,60,0.25); }
.ms-cell.ms-mine-hit { background: rgba(220,60,60,0.55); }
.ms-leaderboard { border-top: 1px solid var(--border); padding-top: 12px; }
.ms-leaderboard-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 8px; }
.ms-leaderboard-list { font-size: 13px; color: var(--text-dim); }
.ms-lb-row { display: flex; gap: 10px; padding: 4px 2px; }
.ms-lb-row span:first-child { width: 28px; color: var(--text-dim); }
.ms-lb-name { flex: 1; color: var(--text); font-weight: 600; }
.ms-score-form { margin-bottom: 12px; font-size: 13px; }
.ms-score-form p { margin: 0 0 8px; color: var(--text); }
.ms-score-form-row { display: flex; gap: 8px; }
.ms-score-form-row input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
}
.ms-score-form-row button {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: var(--lime);
  color: #0a0a0a;
  font-weight: 700;
  cursor: pointer;
}

.finder-group-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 2px 8px;
  border-bottom: 1px solid var(--border);
}
.finder-group-header:not(:first-child) { margin-top: 12px; }
.finder-group-header img { width: 14px; height: 9px; border-radius: 2px; object-fit: cover; }

.finder-grid[hidden] { display: none; }
.finder-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 16px;
  padding: 18px;
  align-content: start;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  scrollbar-width: thin;
}
.finder-grid::-webkit-scrollbar { width: 8px; }
.finder-grid::-webkit-scrollbar-track { background: transparent; }
.finder-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
.finder-grid::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.finder-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: default; text-align: center; text-decoration: none; color: inherit; }
.finder-thumb {
  width: 100%; aspect-ratio: 4/3;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(0,0,0,0.55);
}
.finder-thumb img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.finder-item .fname { font-size: 11px; text-align: center; color: var(--text); }
.finder-item .fmeta { font-size: 10px; color: var(--text-dim); }

/* Folder + video items are real, clickable buttons */
.finder-item-folder, .finder-item-video { cursor: pointer; transition: opacity 0.15s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .finder-item-folder:hover, .finder-item-video:hover { opacity: 0.8; }
}
.finder-thumb-folder {
  position: relative;
  background: var(--icon-surface);
  border: 1px solid rgba(var(--lime-rgb), 0.22);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  padding: 14%;
}
.finder-thumb-folder .icon-glyph { width: 100%; height: 100%; }

/* Country badge — flags a client (e.g. Latvian clients) at a glance */
.client-flag {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--near-black);
  border: 2px solid var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.client-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Client folders with real content get a personalized "profile picture" avatar instead */
.finder-thumb-folder.has-avatar {
  aspect-ratio: 1;
  background: #000;
  border: none;
  border-radius: 50%;
  padding: 0;
  box-shadow: 0 0 0 3px rgba(var(--lime-rgb), 0.35), 0 6px 18px rgba(0,0,0,0.5);
  transition: box-shadow 0.15s var(--ease-out);
}
.finder-thumb-folder.has-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
@media (hover: hover) and (pointer: fine) {
  .finder-item-folder:hover .finder-thumb-folder.has-avatar {
    box-shadow: 0 0 0 3px rgba(var(--lime-rgb), 0.7), 0 8px 22px rgba(0,0,0,0.55);
  }
}
.finder-item-folder .fname { font-weight: 700; font-size: 13px; }

.finder-thumb-video {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  transition: transform 0.15s var(--ease-out);
}
/* Shorts are vertical — give them a vertical tile instead of letterboxing into 16:9 */
.finder-thumb-video.is-vertical { aspect-ratio: 9/16; }
.finder-thumb-video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; pointer-events: none; }
/* Fade-in only applies to actual video thumbnails (the fadeInThumb() JS call
   is what adds .thumb-loaded) — platform-tile avatar/icon images are local,
   always-instant assets and were never wired up to receive that class. */
.finder-thumb-video:not(.platform-tile) img { opacity: 0; transition: opacity 0.25s var(--ease-out); }
.finder-thumb-video:not(.platform-tile) img.thumb-loaded { opacity: 1; }
.video-play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 30%; height: auto; aspect-ratio: 1; max-width: 40px; min-width: 22px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  transition: background 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}
.video-play-badge svg { width: 42%; height: 42%; margin-left: 2px; fill: var(--lime); }
@media (hover: hover) and (pointer: fine) {
  .finder-item-video:hover .finder-thumb-video { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.5); }
  .finder-item-video:hover .video-play-badge { background: var(--lime); }
  .finder-item-video:hover .video-play-badge svg { fill: #0a0a0a; }
}

/* Instagram/Twitter tiles: no reliable thumbnail, so show a branded placeholder instead.
   Vertical (shorts) tiles are tall — icon-over-label fits fine. Horizontal
   (16:9 long-form) tiles are short but wide, so the same stack doesn't have
   the height to spare and clips; those lay out icon-beside-label instead. */
.finder-thumb-video.platform-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-surface);
}
.finder-thumb-video.platform-tile.is-vertical {
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}
.finder-thumb-video.platform-tile:not(.is-vertical) {
  flex-direction: row;
  gap: 12px;
  padding: 10px 16px;
}
.finder-thumb-video.platform-tile img.platform-tile-icon,
.finder-thumb-video.platform-tile img.avatar-icon {
  position: static;
  aspect-ratio: 1;
  flex: 0 0 auto;
}
.finder-thumb-video.platform-tile img.platform-tile-icon { object-fit: contain; }
.finder-thumb-video.platform-tile img.avatar-icon {
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1), 0 4px 12px rgba(0,0,0,0.4);
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
/* Vertical: size off width (the generous axis); horizontal: size off height */
.finder-thumb-video.platform-tile.is-vertical img.platform-tile-icon { width: 32%; max-width: 46px; min-width: 22px; height: auto; }
.finder-thumb-video.platform-tile.is-vertical img.avatar-icon { width: 40%; max-width: 54px; min-width: 26px; height: auto; }
.finder-thumb-video.platform-tile:not(.is-vertical) img.platform-tile-icon { height: 48%; max-height: 40px; min-height: 20px; width: auto; }
.finder-thumb-video.platform-tile:not(.is-vertical) img.avatar-icon { height: 58%; max-height: 48px; min-height: 24px; width: auto; }
.platform-tile-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}
.finder-thumb-video.platform-tile.is-vertical .platform-tile-label { text-align: center; }
.finder-thumb-video.platform-tile:not(.is-vertical) .platform-tile-label { text-align: left; }

/* Vertical (Shorts) grid: narrower columns so more fit per row */
.finder-grid.grid-vertical { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 14px; }

/* Video lightbox: pops the video out big, above everything, instead of playing inline */
.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 24px;
  background: rgba(6, 6, 6, 0.88);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out);
}
.video-lightbox.open { opacity: 1; pointer-events: auto; }
.video-lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
@media (hover: hover) and (pointer: fine) {
  .video-lightbox-close:hover { background: rgba(255, 255, 255, 0.16); }
}
.video-lightbox-frame {
  position: relative;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.65);
}
.video-lightbox-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-lightbox-frame.is-vertical { height: min(80vh, 780px); width: auto; aspect-ratio: 9/16; max-width: 92vw; }
.video-lightbox-frame.is-horizontal { width: min(920px, 92vw); aspect-ratio: 16/9; max-height: 78vh; }

/* Notes window */
.notes-body { background: rgba(255, 216, 77, 0.04); font-size: 14px; line-height: 1.6; }
.notes-body h2 { font-family: var(--font-body); font-weight: 700; font-size: 19px; letter-spacing: 0.2px; margin: 0 0 14px; color: var(--lime); }
.notes-body p { color: var(--text); margin: 0 0 12px; }
.notes-signature { font-family: var(--font-display); font-style: italic; font-weight: 400; font-size: 20px; color: var(--lime); }
.notes-divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.testimonial { font-style: italic; }

/* Services window */
.services-body h2 { font-family: var(--font-body); font-weight: 700; font-size: 19px; letter-spacing: 0.2px; margin: 0 0 18px; color: var(--lime); }
.services-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.services-list li { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.service-name { font-weight: 700; font-size: 14px; }
.service-desc { font-size: 12.5px; color: var(--text-dim); }

/* Mail window */
.mail-body { padding: 0; }
#contact-form { display: flex; flex-direction: column; }
.mail-field {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.mail-field label { color: var(--text-dim); width: 56px; flex: 0 0 auto; }
.mail-field span { color: var(--text); }
#mail-subject, #mail-from {
  flex: 1; background: none; border: none; color: var(--text); font-size: 13px; font-family: inherit; outline: none;
}
#mail-message {
  min-height: 160px; resize: vertical; margin: 14px 18px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: inherit; font-size: 13px; padding: 12px; outline: none;
}
#mail-message:focus { border-color: var(--lime); }
.mail-send {
  align-self: flex-end;
  margin: 0 18px 16px auto;
  background: var(--lime);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 20px;
  border-radius: 8px;
  transition: transform 0.15s var(--ease-out), background 0.15s;
}
@media (hover: hover) and (pointer: fine) {
  .mail-send:hover { background: var(--lime-dim); transform: translateY(-1px); }
}
.mail-send:disabled { opacity: 0.6; cursor: default; transform: none; }

.mail-status {
  margin: 0 18px 10px;
  font-size: 12.5px;
  min-height: 16px;
}
.mail-status.sending { color: var(--text-dim); }
.mail-status.success { color: var(--lime); }
.mail-status.error { color: #ff6b6b; }
.mail-status.error a { color: var(--lime); }

/* ===== Dock ===== */
.dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 9px 12px 7px;
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 20px;
  z-index: 400;
}
.dock-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  transform-origin: bottom center;
  transition: transform 0.18s var(--ease-out);
  position: relative;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.dock-icon .icon-glyph { width: 100%; height: 100%; border-radius: 12px; }
.dock-icon.active::after {
  content: "";
  position: absolute;
  bottom: -5px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--lime);
}
.dock-divider { width: 1px; align-self: stretch; background: var(--border); margin: 4px 2px; }

.dock-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(20,20,20,0.9);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
@media (hover: hover) and (pointer: fine) {
  .dock-icon:hover .dock-tooltip { opacity: 1; }
}

.dock-tooltip.copied {
  opacity: 1;
  border-color: rgba(var(--lime-rgb), 0.55);
  box-shadow: 0 0 18px rgba(var(--lime-rgb), 0.35);
  animation: tooltipPop 0.35s var(--ease-pop);
}
.dock-tooltip.copied .dock-tooltip-text {
  font-weight: 700;
  background: linear-gradient(90deg, var(--lime), #eaffb0, #6f9e1c, var(--lime), #eaffb0);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: bestWorkGradient 1.6s linear infinite;
}
@keyframes tooltipPop {
  0% { transform: translateX(-50%) translateY(-4px) scale(0.85); }
  55% { transform: translateX(-50%) translateY(-11px) scale(1.08); }
  100% { transform: translateX(-50%) translateY(-8px) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .dock-tooltip.copied { animation: none; }
  .dock-tooltip.copied .dock-tooltip-text { animation: none; background-position: 0% 50%; }
}

/* ===== Responsive / mobile app layout ===== */
@media (max-width: 760px) {
  /* backdrop-filter blur is one of the most GPU-expensive properties on mobile
     Safari, and this page stacks it on the menu bar, every window, the dock,
     and the toast simultaneously — on a phone under memory/GPU pressure that
     can manifest as dropped frames, lag, and elements briefly failing to
     paint at all. None of that shows up in desktop-browser testing, only on
     real phones. Drop the blur on mobile and raise the background opacity
     a bit to compensate for the lost softening. */
  .menubar, .window, .dock, .notification-toast, .video-lightbox {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .menubar { background: rgba(10, 10, 10, 0.92); }
  .window { background: rgba(20, 20, 22, 0.96); }
  .dock { background: rgba(16, 16, 16, 0.92); }
  .notification-toast { background: rgba(14, 14, 14, 0.94); }
  .video-lightbox { background: rgba(4, 4, 4, 0.96); }

  /* Three large continuously-animating 90px-blur blobs, plus the full-screen
     grain overlay, add up fast on weaker GPUs — cut both on mobile. */
  .aurora, .grain { display: none; }

  /* Menu bar: strip it down to a bigger, easier-to-tap phone status bar */
  .menubar-menu { display: none; }
  #menubar-date { display: none; }
  .menubar { height: 48px; padding: 0 16px; font-size: 15px; }
  .menubar-logo img { height: 20px; }
  .menubar-item.strong { font-size: 15px; }
  .menubar-right { gap: 12px; }
  .menubar-bell { padding: 10px; margin: -10px; }
  .menubar-bell svg { width: 20px; height: 20px; }
  .bell-dot { top: 6px; right: 6px; width: 8px; height: 8px; }
  #menubar-clock { font-size: 14px; }

  /* No mouse-only chrome on touch */
  .cursor-glow { display: none; }
  .window-resize-handle { display: none; }

  /* Brand logo: large, top-center, fills the space above the icon grid */
  .brand-lockup { top: 188px; transform: translateX(-50%); }
  /* Mobile Safari has a known bug where a large-blur drop-shadow filter on
     an image can render its offscreen filter buffer as a visible hard-edged
     box instead of fading out — drop it here rather than risk it. */
  .brand-logo-img { width: clamp(220px, 70vw, 310px); filter: none; }

  /* App-grid icon layout, centered in the space between logo and dock */
  .desktop-icons-wrap {
    display: grid;
    grid-template-columns: repeat(4, 82px);
    gap: 26px 10px;
    justify-content: center;
    align-content: center;
    position: absolute;
    top: 368px;
    bottom: 110px;
    left: 0;
    right: 0;
    z-index: 5;
  }
  .desktop-icon {
    position: static !important;
    width: 82px !important;
    cursor: default;
  }
  .desktop-icon:hover { background: none; }
  .icon-glyph { width: 54px; height: 54px; }
  .desktop-icon .icon-label { font-size: 11px; }

  /* Anchor both top AND bottom instead of a max-height in vh — mobile browsers
     compute vh against the tallest possible viewport (address bar collapsed),
     so a vh-based height can end up taller than what's actually visible and
     get its bottom edge trapped under the fixed dock. Anchoring to `bottom`
     (with room for the dock + safe-area) keeps the window's real edge always
     above it, on any viewport/address-bar state. */
  .window {
    width: 92vw;
    top: 128px;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    max-height: none;
    margin-left: 0 !important;
    margin-top: 0 !important;
  }

  /* Drop the 3-dot traffic lights for a single, clean close (X) button */
  .window-titlebar { height: 48px; padding: 0 14px; position: relative; }
  .window-title { position: absolute; left: 0; right: 0; margin-right: 0; text-align: center; pointer-events: none; }
  .traffic {
    display: flex;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 0;
    gap: 0;
  }
  .dot-yellow, .dot-green { display: none; }
  .dot-red {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
  }
  .dot-red::before,
  .dot-red::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 1.5px;
    background: var(--text-dim);
    border-radius: 2px;
  }
  .dot-red::before { transform: translate(-50%, -50%) rotate(45deg); }
  .dot-red::after { transform: translate(-50%, -50%) rotate(-45deg); }
  .dot-red:active { background: rgba(255, 255, 255, 0.12); }

  /* Video lightbox: less padding, close button stays easy to reach */
  .video-lightbox { padding: 24px 16px; gap: 12px; }
  .video-lightbox-close { top: 14px; right: 14px; width: 44px; height: 44px; }
  .video-lightbox-frame.is-vertical { height: min(72vh, 700px); }

  /* Contact form: larger touch targets, 16px inputs (avoids iOS auto-zoom) */
  .mail-field { padding: 14px 16px; font-size: 14px; }
  .mail-field label { width: 60px; }
  #mail-subject, #mail-from { font-size: 16px; padding: 4px 0; }
  #mail-message { font-size: 16px; min-height: 140px; margin: 14px 16px; padding: 14px; }
  .mail-send {
    width: calc(100% - 32px);
    margin: 4px 16px 16px;
    text-align: center;
    padding: 14px 20px;
    font-size: 15px;
  }
  .mail-status { margin: 0 16px 12px; font-size: 13px; }

  /* Finder sidebar becomes a horizontal scrollable tab strip */
  /* No vh cap here either — the outer .window is now correctly bounded by
     top+bottom anchoring above, so this just fills whatever space that leaves. */
  .finder-body { flex-direction: column; height: auto; max-height: none; }
  .finder-sidebar {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: auto;
    gap: 6px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }
  .finder-section { display: none; }
  .finder-row {
    display: block;
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    margin-bottom: 0;
    text-align: center;
    padding: 14px;
    font-size: 13px;
  }

  /* Portfolio toolbar: bigger tap target for Back */
  .finder-toolbar { padding: 10px 16px; }
  .finder-back { font-size: 14px; padding: 13px 12px 13px 8px; margin: 0; }
  .finder-path { font-size: 12.5px; }

  /* Folders/videos: full-width tappable rows instead of a small thumbnail grid.
     .grid-vertical also has to be overridden here — it's equally specific but
     defined earlier, so without repeating it, shorts grids stayed multi-column. */
  .finder-grid, .finder-grid.grid-vertical { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .finder-item-folder, .finder-item-video {
    display: grid;
    grid-template-columns: 68px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 3px;
    width: 100%;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
  }
  .finder-item-folder .finder-thumb, .finder-item-video .finder-thumb {
    grid-row: 1 / 3;
    grid-column: 1;
    width: 68px;
  }
  .finder-item-folder .fname, .finder-item-video .fname {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .finder-item-folder .fmeta, .finder-item-video .fmeta {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
    font-size: 12px;
  }
  .video-play-badge { width: 28px; height: 28px; }

  /* Videos carry no caption anymore, so the 68px-row layout above (built for
     folder rows with a name + count) doesn't apply — give them a compact
     thumbnail grid instead, same idea as the desktop view. */
  .finder-grid.grid-videos { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; padding: 12px; }
  .finder-grid.grid-videos .finder-item-video {
    display: block;
    width: auto;
    padding: 0;
    border-radius: 10px;
    background: none;
  }
  .finder-grid.grid-videos .finder-item-video .finder-thumb {
    grid-row: auto;
    grid-column: auto;
    width: 100%;
  }

  /* Compact tile is too short for icon + label — icon alone is enough.
     Icon sizing itself already adapts (see the is-vertical / row rules
     above), so nothing else to override here. */
  .platform-tile-label { display: none; }

  .brand-word { font-size: clamp(36px, 13vw, 72px); }

  /* Bottom taskbar: full-width phone tab bar with just the social links */
  .dock-app { display: none; }
  .dock {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    justify-content: space-evenly;
    align-items: center;
    gap: 0;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .dock-icon { width: 56px; height: 56px; flex: 0 0 auto; }
}
