body {
  font-family: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
}

/* ─── Sidebar ─── */
.sidebar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 16px;
  z-index: 100;
  background: rgba(10, 10, 10, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0 12px 12px;
  min-width: 160px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.sidebar-dragbar {
  height: 24px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  user-select: none;
}
.sidebar-dragbar::after {
  content: '';
  width: 20px;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
.sidebar-dragbar:active {
  cursor: grabbing;
}
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 4px;
  padding-left: 2px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.sidebar-thumb {
  width: 44px;
  height: 33px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
}
.sidebar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}
.sidebar-title {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-icon {
  font-size: 16px;
  width: 44px;
  height: 33px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.sidebar-item:hover .sidebar-icon {
  opacity: 0.9;
}
.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 6px 0;
}

/* ─── Menu Bar ─── */
.menu-bar {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(10, 10, 10, 0.35);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 6px 4px;
  display: inline-flex;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.menu-bar .menu-category {
  color: rgba(255, 255, 255, 0.5);
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.menu-bar .menu-category:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
}

/* ─── Desktop Icons ─── */
.desktop-icon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 80px;
  cursor: grab;
  padding: 6px 4px;
  border-radius: 8px;
  transition: background 0.15s;
}
.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.04);
}
.desktop-icon.selected {
  background: rgba(255, 255, 255, 0.06);
  outline: 1px solid rgba(255, 255, 255, 0.15);
}
.desktop-icon:active {
  cursor: grabbing;
}

.icon-box {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s, border-color 0.2s;
}
.desktop-icon:hover .icon-box {
  transform: scale(1.12);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.desktop-icon.selected .icon-box {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}
.desktop-icon.dragging .icon-box {
  transform: scale(1.04);
  opacity: 0.85;
}

.icon-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  line-height: 1.25;
  word-break: keep-all;
  max-width: 76px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  padding: 1px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.desktop-icon:hover .icon-label {
  opacity: 1;
}
.desktop-icon.selected .icon-label {
  background: rgba(59, 130, 246, 0.3);
  color: #fff;
}

/* ─── Windows ─── */
.window {
  position: absolute;
  border-radius: 6px;
  background: rgba(15, 15, 15, 0.88);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 40px rgba(0, 0, 0, 0.3);
  animation: windowIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.window.closing {
  animation: windowOut 0.18s ease-in forwards;
}
.window.minimized {
  display: none;
}
.window.maximized {
  border-radius: 0;
  border-color: transparent;
}

@keyframes windowIn {
  0%   { opacity: 0; transform: scale(0.92) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes windowOut {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.94) translateY(8px); }
}

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: grab;
  flex-shrink: 0;
  min-height: 36px;
  position: relative;
}
.window-titlebar:active {
  cursor: grabbing;
}

.window-controls {
  display: flex;
  gap: 7px;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

.window-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: filter 0.15s;
  position: relative;
}
.window-btn:hover {
  filter: brightness(1.2);
}

.window-btn-close   { background: #ff5f57; }
.window-btn-minimize{ background: #febc2e; }
.window-btn-maximize{ background: #28c840; }

/* ─── Window title ─── */
.window-title {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

.window-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
  max-height: calc(100% - 37px); /* titlebar height */
}

/* Scrollbar styling */
.window-body::-webkit-scrollbar {
  width: 6px;
}
.window-body::-webkit-scrollbar-track {
  background: transparent;
}
.window-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
.window-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ─── Video Player ─── */
.video-container video {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: #000;
}

/* ─── Contact form ─── */
.contact-field {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  outline: none;
  transition: border-color 0.2s;
}
.contact-field:focus {
  border-color: rgba(59, 130, 246, 0.5);
}
.contact-field::placeholder {
  color: rgba(255, 255, 255, 0.25);
}
textarea.contact-field {
  resize: vertical;
  min-height: 80px;
}

/* ─── Resize handles ─── */
.resize-handle {
  position: absolute;
  z-index: 20;
}
.resize-handle-e {
  right: 0; top: 0; width: 5px; height: 100%;
  cursor: e-resize;
}
.resize-handle-s {
  bottom: 0; left: 0; width: 100%; height: 5px;
  cursor: s-resize;
}
.resize-handle-se {
  right: 0; bottom: 0; width: 14px; height: 14px;
  cursor: se-resize;
}
.resize-handle-sw {
  left: 0; bottom: 0; width: 14px; height: 14px;
  cursor: sw-resize;
}

/* ─── Filtre catégorie ─── */
.desktop-icon.dimmed {
  opacity: 0.15;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.menu-category.active-category {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

/* ─── Barre bicolore pour projet multi-catégorie ─── */
.icon-box-dual {
  position: relative;
}
.icon-box-dual::before,
.icon-box-dual::after {
  content: '';
  position: absolute;
  top: 0;
  height: 2px;
  z-index: 1;
  pointer-events: none;
}
.icon-box-dual::before {
  left: 0;
  width: 50%;
  background: #b91c1c;
}
.icon-box-dual::after {
  right: 0;
  width: 50%;
  background: #dc2626;
}

/* ─── Barre rouge/jaune (captation + motion) ─── */
.icon-box-dual-bp {
  position: relative;
}
.icon-box-dual-bp::before,
.icon-box-dual-bp::after {
  content: '';
  position: absolute;
  top: 0;
  height: 2px;
  z-index: 1;
  pointer-events: none;
}
.icon-box-dual-bp::before {
  left: 0;
  width: 50%;
  background: #b91c1c;
}
.icon-box-dual-bp::after {
  right: 0;
  width: 50%;
  background: #ca8a04;
}

/* ─── Barre rouge/jaune (montage + motion) ─── */
.icon-box-dual-vp {
  position: relative;
}
.icon-box-dual-vp::before,
.icon-box-dual-vp::after {
  content: '';
  position: absolute;
  top: 0;
  height: 2px;
  z-index: 1;
  pointer-events: none;
}
.icon-box-dual-vp::before {
  left: 0;
  width: 50%;
  background: #dc2626;
}
.icon-box-dual-vp::after {
  right: 0;
  width: 50%;
  background: #ca8a04;
}

/* ─── Barre tricolore pour projet 3 catégories ─── */
.icon-box-triple {
  position: relative;
}
.icon-box-triple::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to right, #b91c1c 33.33%, #dc2626 33.33%, #dc2626 66.66%, #ca8a04 66.66%);
}

/* ─── Marquee logos ─── */
.marquee-container {
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.marquee-track {
  display: flex;
  gap: 5rem;
  align-items: center;
  width: fit-content;
  will-change: transform;
}
.brand-logo {
  cursor: pointer;
  transition: filter 0.25s ease, opacity 0.25s ease;
}
.brand-logo.brand-active {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(7404%) hue-rotate(4deg) brightness(95%) contrast(118%);
}

/* ─── 📱 Mobile (< 768px) ─── */
@media (max-width: 768px), (max-height: 600px) {
  html, body {
    overflow: auto !important;
    width: 100%;
    height: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  body {
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  section, main, header {
    max-width: 100vw !important;
    box-sizing: border-box;
  }

  /* Menu bar — fenêtre flottante glass */
  .menu-bar {
    position: absolute !important;
    top: 12px !important;
    left: 50% !important;
    width: auto !important;
    transform: translateX(-50%) !important;
    border-radius: 12px !important;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 10px !important;
    z-index: 9999 !important;
    max-width: calc(100vw - 24px);
  }
  .menu-bar .flex.items-center {
    gap: 0.8rem !important;
    flex-shrink: 0;
    justify-content: center;
    width: 100%;
  }
  .menu-bar .flex.items-center > span {
    white-space: nowrap;
    font-size: 11px;
    padding: 6px 8px;
  }

  /* Hamburger button for sidebar */
  .mobile-menu-btn {
    display: flex !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(10,10,10,0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  }

  /* Sidebar → drawer latéral (droite) */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    right: -280px !important;
    left: auto !important;
    transform: none !important;
    width: 260px !important;
    height: 100vh !important;
    border-radius: 16px 0 0 16px !important;
    z-index: 10002 !important;
    transition: right 0.3s cubic-bezier(0.22, 1, 0.36, 1) !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .sidebar.open {
    right: 0 !important;
  }
  .sidebar-dragbar {
    display: none !important;
  }
  /* Overlay sombre derrière la sidebar */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10001;
  }
  .sidebar-overlay.visible {
    display: block;
  }

  /* Desktop — full screen locké comme sur l'ordi */
  #desktop {
    height: 100dvh !important;
    overflow: hidden !important;
    touch-action: none;
    padding: 0 !important;
    padding-top: 56px !important;
    padding-bottom: 0 !important;
  }

  /* Cacher le séparateur et le bouton Qui suis-je dans le menu mobile */
  .menu-bar .text-gray-600.mx-2 {
    display: none !important;
  }
  .menu-bar [onclick="scrollToAbout()"] {
    display: none !important;
  }

  /* Titre & horloge en mobile */
  h1 {
    display: none !important;
  }
  #clock-desktop {
    display: none !important;
  }
  #portfolio-title {
    display: none !important;
  }

  /* Icônes : plus grosses pour le cercle mobile */
  .desktop-icon {
    padding: 4px !important;
    width: 88px !important;
  }
  .desktop-icon .icon-label {
    display: none !important;
  }
  .desktop-icon.selected .icon-label {
    background: rgba(59,130,246,0.3);
    color: #fff;
  }
  .icon-box {
    width: 68px !important;
    height: 68px !important;
    border-radius: 0 !important;
    border-width: 1px !important;
  }
  .icon-box img {
    object-fit: cover;
  }
  .icon-box-dual,
  .icon-box-dual-bp,
  .icon-box-dual-vp,
  .icon-box-triple {
    border-top: none !important;
  }

  /* Curseur drag mobile */
  .desktop-icon.dragging {
    z-index: 999;
    opacity: 0.85;
    transform: scale(1.08);
  }
  .desktop-icon.dragging .icon-box {
    transform: scale(1.08);
  }

  /* Logos panel — au-dessus du bouton */
  #logos-panel {
    position: fixed !important;
    min-width: auto !important;
    width: calc(100vw - 24px) !important;
    left: 12px !important;
    right: 12px !important;
    transform: none !important;
    padding: 14px 16px !important;
    bottom: 80px !important;
    transition: opacity 0.35s ease;
  }
  #logos-panel.fade-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
  }
  #logos-panel .marquee-track {
    gap: 3rem !important;
  }
  #logos-panel .brand-logo {
    height: 28px !important;
  }

  /* Bouton Qui suis-je mobile — au-dessus des logos */
  #about-mobile-btn {
    display: block !important;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    background: rgba(10,10,10,0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 8px 24px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  }

  /* ─── Paysage : boutons en bas en ligne ─── */
  @media (orientation: landscape) and (max-height: 600px) {
    /* Disposition horizontale : [Qui suis-je] [logos] [☰] */
    #about-mobile-btn {
      bottom: 16px !important;
      left: 12px !important;
      transform: none !important;
      font-size: 11px !important;
      padding: 6px 16px !important;
    }
    #logos-panel {
      bottom: 16px !important;
      left: 50% !important;
      right: auto !important;
      transform: translateX(-50%) !important;
      width: auto !important;
      min-width: auto !important;
      max-width: calc(100vw - 240px) !important;
      padding: 8px 14px !important;
    }
    #logos-panel .brand-logo {
      height: 22px !important;
    }
    .mobile-menu-btn {
      bottom: 16px !important;
      right: 12px !important;
    }
    /* Ajuster le menu bar pour qu'il soit plus compact */
    .menu-bar {
      padding: 4px 8px !important;
      top: 6px !important;
    }
    .menu-bar .flex.items-center > span {
      font-size: 10px !important;
      padding: 4px 6px !important;
    }
    /* Icônes plus petites en paysage */
    .desktop-icon {
      width: 68px !important;
      padding: 2px !important;
    }
    .desktop-icon .icon-box {
      width: 52px !important;
      height: 52px !important;
    }
    .desktop-icon .icon-label {
      font-size: 8px !important;
    }
  }

  /* Fenêtres → plein écran */
  .window {
    position: fixed !important;
    top: 36px !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 36px) !important;
    border-radius: 0 !important;
    z-index: 10000 !important;
    animation: mobileWindowIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .window.closing {
    animation: mobileWindowOut 0.2s ease-in forwards !important;
  }
  .resize-handle {
    display: none !important;
  }
  .window-titlebar {
    cursor: default !important;
    min-height: 32px !important;
    padding: 6px 12px !important;
  }
  .window-body {
    max-height: calc(100% - 33px) !important;
	    -webkit-overflow-scrolling: touch;
	    overflow-y: auto !important;
  }
  .window-btn-minimize {
    display: none !important;
  }
  @keyframes mobileWindowIn {
    0%   { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
  }
  @keyframes mobileWindowOut {
    0%   { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
  }

  /* CV fenêtre en mobile */
  .window .flex.h-full {
    flex-direction: column !important;
  }
  .window .w-\[35\%\] {
    width: 100% !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    padding: 0.5rem !important;
    gap: 0.5rem;
  }
  .window .w-\[35\%\] > div {
    flex: 1;
    min-width: 100px;
	  .window .flex.h-full {
	    overflow-y: auto !important;
	    -webkit-overflow-scrolling: touch;
	  }
	  .window .text-sm {
	    font-size: 0.7rem !important;
	  }
	  .window .text-xs {
	    font-size: 0.6rem !important;
	  }
	  .window .text-2xl {
	    font-size: 1.1rem !important;
	  }
	  .window .w-16.h-16 {
	    width: 2.5rem !important;
	    height: 2.5rem !important;
	  }
  }

  /* Qui suis-je — version mobile */
  #about {
    margin-top: 0 !important;
    padding: 4rem 1.25rem !important;
    min-height: 100dvh !important;
  }
  #about .w-48 {
    width: 7rem !important;
    height: 7rem !important;
  }
  #about h2 {
    font-size: 1.25rem !important;
  }
  #about .text-sm {
    font-size: 0.85rem !important;
    line-height: 1.6 !important;
  }
  #retour-btn {
    bottom: 12px !important;
    padding: 10px 20px !important;
    font-size: 12px !important;
  }
}

/* Masqué par défaut sur desktop */
.mobile-menu-btn {
  display: none;
}
.sidebar-overlay {
  display: none;
}

