:root {
  --fg:#eaeaea;
  --muted:#9b9b9b;
  --panel:#101010;
  --panel2:#161616;
  --radius:10px;
}

/* RESET */
*{box-sizing:border-box;margin:0;padding:0}
html,body{
  height:100%;
  overflow:hidden;
  font-family:'Inter',sans-serif;
  background:transparent !important;
  color:var(--fg);
}


/* Image de fond */
.bg-image {
  background: url('../images/background.jpg') center/cover no-repeat;
  opacity: .25;
  filter: brightness(0.6) blur(2px);
  animation: bgZoom 40s ease-in-out infinite alternate;
}
@keyframes bgZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}


/* ---------- FOND DIGITAL WORKSPACE GLITCH ---------- */
#digital-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #101010 0%, #000 100%);
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  inset: 0;
  mix-blend-mode: screen;
}

/* Lignes horizontales (scanlines) */
.bg-lines {
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0.05) 0 1px,
    transparent 2px 4px
  );
  opacity: .22;
  animation: scanShift 8s linear infinite;
}
@keyframes scanShift {
  0%   { background-position: 0 0; }
  100% { background-position: 0 6px; }
}

/* Bruit électronique mouvant */
.bg-noise {
  background:
    repeating-radial-gradient(circle at 10% 20%, rgba(255,255,255,.06) 0 1px, transparent 1px 6px),
    repeating-radial-gradient(circle at 80% 80%, rgba(255,255,255,.05) 0 1px, transparent 1px 5px);
  opacity: .07;
  animation: noiseShift 900ms steps(2,end) infinite;
}
@keyframes noiseShift {
  0%,100% { transform: translate(0,0); }
  50% { transform: translate(1px,-1px); }
}

/* Effet glitch : micro-pulsations irrégulières */
.bg-glitch {
  background:
    linear-gradient(90deg, rgba(255,255,255,.04) 50%, transparent 50%);
  background-size: 4px 100%;
  opacity: .06;
  animation: glitchPulse 1.6s steps(3,end) infinite;
}
@keyframes glitchPulse {
  0%,100% { transform: translate(0,0); opacity:.04; }
  40% { transform: translate(-2px,1px); opacity:.08; }
  70% { transform: translate(1px,-1px); opacity:.06; }
}

/* Balayage horizontal type CRT */
.bg-scan {
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
  opacity: .15;
  animation: scanSweep 5s ease-in-out infinite;
}
@keyframes scanSweep {
  0% { transform: translateY(-100%); opacity: 0; }
  40% { opacity: .2; }
  50% { transform: translateY(100%); opacity: .15; }
  100% { opacity: 0; }
}

/* ---------- PRELOADER ---------- */
#preloader {
  position: fixed; inset: 0; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9999; transition: opacity 1s ease;
}
#preloader.fade-out { opacity: 0; pointer-events: none; }
#preloader-logo { width: 200px; opacity: 0; transform: translateY(20px); animation: logoIn 1.2s ease forwards .5s; }
@keyframes logoIn { to { opacity: 1; transform: none; } }

/* Texte OS style */
.boot-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #a0a0a0;
  margin-top: 30px;
  opacity: 0;
  animation: textFade 1s ease forwards 1.2s;
  letter-spacing: .05em;
}
.boot-text .blink {
  animation: blink 1s steps(2, start) infinite;
  color: #5af7ff;
}
@keyframes blink { to { visibility: hidden; } }

.boot-scan { position: absolute; inset: 0; background: linear-gradient(180deg,transparent 0%,rgba(255,255,255,0.15) 40%,transparent 100%); animation: scanMove 1.8s ease-in-out 2; }
@keyframes scanMove { from { transform: translateY(-100%); } to { transform: translateY(100%); } }
@keyframes textFade { to { opacity: 1; } }

/* ---------- CONSOLE ---------- */
.console {
  position: fixed;
  top: 60px;
  left: 4px;
  font: 12px "JetBrains Mono", monospace;
  color: var(--muted);
  background: rgba(0,0,0,.45);
  border: 1px solid #1b1b1b;
  border-radius: 6px;
  padding: 8px 10px;
  z-index: 20;
  opacity: 0;
  transform: translateX(-10px);
  animation: consoleIn 1.4s ease forwards 5.2s;
}

@keyframes consoleIn {
  0% { opacity: 0; transform: translateX(-10px); }
  50% { opacity: 0.6; transform: translateX(0); }
  100% { opacity: 1; transform: none; }
}

.console .tag {
  color: #5af7ff;
  margin-right: 6px;
}

@keyframes blink { to { visibility: hidden; } }



/* Style du tag coloré */
.console .tag {
  color: #5af7ff;
  margin-right: 6px;
}


/* ---------- TOPBAR ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  background: rgba(10,10,10,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #1b1b1b;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 100;
}
.topbar .brand {
  font: 700 13px "Space Grotesk",sans-serif;
  letter-spacing: .18em;
  background: linear-gradient(90deg, cyan, magenta, yellow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.menu-group { display: flex; align-items: center; gap: 16px; }
.topbar .menu { display: flex; gap: 18px; }
.topbar button {
  background: none; border: none; color: var(--fg);
  font: 13px "Space Grotesk"; cursor: pointer; transition: .2s; padding: 6px 8px;
}
.topbar button:hover { color: #5af7ff; }
#close-all {
  color: #eaeaea;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  background: rgba(0,0,0,0.4);
  cursor: pointer;
  transition: .25s ease;
}
#close-all:hover {
  background: linear-gradient(90deg, cyan, magenta, yellow);
  color: #000;
}

/* ---------- WORKSPACE & WINDOWS ---------- */
#workspace {
  position: relative;
  z-index: 40;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding-top: 56px;
  background: transparent !important;
}
.window {
  position: absolute; background: var(--panel2);
  border: 1px solid #222; border-radius: var(--radius);
  width: min(850px,90vw);
  box-shadow: 0 10px 60px rgba(0,0,0,.6);
  animation: fadeIn .25s ease; overflow: hidden;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.win-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #111; border-bottom: 1px solid #222; padding: 8px 12px; cursor: move;
}
.win-bar .title { font: 12px "JetBrains Mono"; color: var(--muted); }
.win-close { background: none; border: none; color: var(--fg); font-size: 18px; cursor: pointer; transition: .2s; }
.win-close:hover { color: #5af7ff; }
.win-body { padding: 20px; font-size: 14px; line-height: 1.6; }
.win-body h2 { font: 600 20px "Space Grotesk"; margin-bottom: 10px; }
.win-body img { width: 100%; border-radius: 8px; margin-bottom: 10px; }
.window:focus-within { outline: 1px solid #5af7ff; outline-offset: -1px; }

.footer { position: fixed; bottom: 6px; right: 12px; color: var(--muted); font: 12px "Space Grotesk"; z-index: 40; }

/* ---------- WORKS GRID ---------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.work-item {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}

.work-item:hover {
  transform: scale(1.03);
  box-shadow: 0 0 25px rgba(0,0,0,0.4);
}

.work-item img,
.work-item video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
  transition: filter .3s ease;
}

.work-item:hover img,
.work-item:hover video {
  filter: brightness(1);
}

.work-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  padding: 10px 12px;
  font: 600 14px "Space Grotesk", sans-serif;
  color: #fff;
  pointer-events: none;
}


/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .window {
    width: 92vw;
    left: 4vw !important;
    top: 70px !important;
    transform: none !important;
    max-height: 80vh;
    overflow-y: auto;
  }

  .win-close {
    font-size: 22px;
    padding: 4px;
  }

  .win-bar {
    padding: 8px 10px;
  }
}
@media (max-width: 768px) {
  .topbar {
    height: 48px;
    padding: 0 10px;
  }

  .menu-group {
    gap: 10px;
  }

  /* Menu visible sous forme réduite */
  .topbar .menu {
    display: flex;
    gap: 10px;
  }

  .topbar button {
    font-size: 12px;
    padding: 4px 6px;
  }

  #close-all {
    font-size: 11px;
    padding: 4px 8px;
  }
}

