/* ==========================================================================
   bychudy.com Inspired macOS Desktop Portfolio System for Casey
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-color: #0b0c10;
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.65);
  --glass-bg: rgba(20, 22, 28, 0.72);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --accent-color: #3b82f6;
  --window-header-height: 38px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Background Spatial Layer */
#desktop-canvas {
  position: relative;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  overflow: hidden;
}

.ambient-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.7) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Custom Wallpaper Artwork */
.portrait-backdrop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.92;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 1;
}

/* Top Navigation Status Bar */
.mac-menu-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: rgba(10, 12, 16, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  z-index: 999;
}

.menu-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-logo {
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  cursor: pointer;
}

.menu-item {
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.menu-item:hover {
  color: #fff;
}

.menu-right {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 11px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

/* Scattered Desktop Project Icons - Direct Image Artwork Tiles */
.desktop-grid {
  position: absolute;
  inset: 30px 0 90px 0;
  z-index: 2;
  pointer-events: none;
}

.desktop-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 86px;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  will-change: left, top, transform;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.desktop-item img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.desktop-item:hover {
  transform: scale(1.08) translateY(-2px);
  z-index: 10;
}

.desktop-item.is-dragging {
  cursor: grabbing !important;
  transform: scale(1.12) translateY(-4px) !important;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.85));
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
  z-index: 300 !important;
}

.desktop-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 4px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}

.desktop-label {
  margin-top: 5px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.9);
  line-height: 1.15;
  padding: 1px 4px;
  border-radius: 2px;
  max-width: 95px;
  word-break: break-word;
}

.desktop-item:hover .desktop-label {
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  text-shadow: none;
}

/* macOS Solid App Dock */
.dock-container {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(20, 20, 24, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.dock-item {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #18181c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease-out;
  transform-origin: bottom center;
}

.dock-item.adobe-ae { background: #00005b; border-color: #9999ff; }
.dock-item.adobe-ps { background: #001e36; border-color: #31a8ff; }
.dock-item.adobe-ai { background: #330000; border-color: #ff9a00; }
.dock-item.app-warn { background: #2a2200; border-color: #eab308; }
.dock-item.app-notes { background: #ffffff; color: #000; }
.dock-item.app-photos { background: #ffffff; }
.dock-item.app-spotify { background: #121212; border-color: #1ed760; }
.dock-item.app-insta { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.dock-item.app-mail { background: #0078d4; }
.dock-item.app-trash { background: #27272a; }

.dock-item img, .dock-icon-svg {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.dock-app-tag {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  color: #fff;
}

.dock-app-tag.ae { color: #9999ff; text-shadow: 0 0 10px rgba(153, 153, 255, 0.6); }
.dock-app-tag.ps { color: #31a8ff; text-shadow: 0 0 10px rgba(49, 168, 255, 0.6); }
.dock-app-tag.ai { color: #ff9a00; text-shadow: 0 0 10px rgba(255, 154, 0, 0.6); }

.dock-tooltip {
  position: absolute;
  top: -38px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.dock-item:hover .dock-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dock-divider {
  width: 1px;
  height: 38px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 2px;
  align-self: center;
}

/* macOS Windows Stack System */
.window-container {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.mac-window {
  position: absolute;
  min-width: 320px;
  max-width: 90vw;
  background: var(--glass-bg);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.92) translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mac-window.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.mac-window.focused {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.4);
}

/* Window Header Bar */
.window-header {
  height: var(--window-header-height);
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  cursor: move;
}

.window-traffic-lights {
  display: flex;
  align-items: center;
  gap: 8px;
}

.traffic-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: rgba(0, 0, 0, 0.6);
}

.traffic-btn.close { background-color: #ff5f56; border: 1px solid #e0443e; }
.traffic-btn.minimize { background-color: #ffbd2e; border: 1px solid #dea123; }
.traffic-btn.maximize { background-color: #27c93f; border: 1px solid #1aab29; }

.traffic-btn:hover {
  filter: brightness(0.85);
}

.window-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  flex: 1;
}

.window-header-actions {
  width: 50px;
}

/* Window Body Content */
.window-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 75vh;
  color: rgba(255, 255, 255, 0.9);
}

.window-body::-webkit-scrollbar {
  width: 6px;
}

.window-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Project Detail View */
.project-modal-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.project-cover-large {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  object-fit: cover;
  max-height: 380px;
}

.project-meta-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #60a5fa;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.project-title-large {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.project-client-line {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.project-desc-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
}

.project-features-list {
  list-style: none;
}

.project-features-list li {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 14px;
  position: relative;
}

.project-features-list li::before {
  content: "•";
  color: #3b82f6;
  position: absolute;
  left: 0;
  font-size: 14px;
}

/* Notebook / Kajecik Window Styling */
.notebook-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.bio-card {
  display: flex;
  gap: 20px;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.bio-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-color);
}

.experience-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #3b82f6;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}

.timeline-role {
  font-weight: 800;
  font-size: 14px;
}

.timeline-company {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.timeline-desc {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}

/* Gallery Showcase Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.gallery-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-card:hover img {
  transform: scale(1.08);
}

.gallery-caption {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  padding: 10px;
  font-size: 11px;
  font-weight: 700;
}

/* Humorous Adobe Crash Dialog */
.adobe-dialog-box {
  text-align: center;
  padding: 10px 10px 0 10px;
}

.adobe-icon-warning {
  font-size: 42px;
  margin-bottom: 12px;
}

.adobe-msg-text {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 20px;
}

.adobe-btn-action {
  padding: 8px 22px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.adobe-btn-action:hover {
  background: #dc2626;
}

/* Responsive Mobile Layout adjustments */
@media (max-width: 768px) {
  .desktop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
    inset: 40px 0 100px 0;
    overflow-y: auto;
  }

  .desktop-item {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100%;
  }

  .project-modal-grid {
    grid-template-columns: 1fr;
  }

  .dock-container {
    bottom: 8px;
    padding: 6px 10px;
    gap: 4px;
  }

  .dock-item {
    width: 40px;
    height: 40px;
  }
}
