@font-face {
  font-family: 'Aero';
  src: url('fonts/Aero.ttf');
  font-display: swap;
}

@font-face {
  font-family: 'Ledlight';
  src: url('fonts/LEDLIGHT.otf');
  font-display: swap;
}

@font-face {
  font-family: 'Linebeam';
  src: url('fonts/Linebeam.ttf');
  font-display: swap;
}

:root {
  --xp-blue: #0058e6;
  --xp-blue-light: #3a93ff;
  --xp-blue-dark: #002375;
  --xp-border: #0055ea;
  --xp-face: #ece9d8;
  --xp-green: #63db00;
  --nerv-red: #d81e05;
  --ui-font: Tahoma, Verdana, 'Segoe UI', Geneva, sans-serif;
  --taskbar-h: 36px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--ui-font);
  font-size: 13px;
  color: #000;
  background-color: #3a6ea5;
  background-image: url('images/background.jpg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  overflow: hidden;
}

a {
  color: #0033cc;
}

/* ---------- Bureau ---------- */

.desktop {
  position: relative;
  height: calc(100vh - var(--taskbar-h));
  height: calc(100dvh - var(--taskbar-h));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.desktop-icons {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 80px;
  padding: 4px;
  border: 1px dotted transparent;
  background: none;
  font: inherit;
  color: #fff;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.desktop-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.6));
}

.desktop-icon span {
  font-size: 11px;
  padding: 1px 3px;
  text-shadow: 1px 1px 2px #000;
  word-break: break-all;
}

.desktop-icon:hover span,
.desktop-icon:focus-visible span {
  background: #316ac5;
  text-shadow: none;
}

.desktop-icon:focus-visible {
  outline: none;
  border-color: #fff;
}

/* ---------- Fenêtres XP ---------- */

.main-page {
  display: flex;
  flex-direction: column;
  border: 3px solid var(--xp-border);
  border-top: 0;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  background-color: #ffffff;
  width: 50vw;
  max-width: 900px;
  height: 100%;
  max-height: 900px;
  overflow: hidden;
  box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.8);
  position: relative;
  z-index: 1;
}

.main-page.left-window,
.main-page.right-window {
  width: 15vw;
  min-width: 190px;
  max-width: 280px;
}

.main-page.is-hidden {
  display: none;
}

.main-page.is-maximized {
  position: fixed;
  inset: 0 0 var(--taskbar-h) 0;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  border-radius: 0;
  z-index: 50;
}

.xp-window-header {
  background: linear-gradient(to bottom, #0058e6 0%, #3a93ff 8%, #0058e6 40%, #0054e3 88%, #0049c8 100%);
  padding: 5px 6px 5px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
  border-bottom: 1px solid var(--xp-blue-dark);
  flex-shrink: 0;
  user-select: none;
}

.main-page:not(.is-active) .xp-window-header {
  background: linear-gradient(to bottom, #7a96df 0%, #a6bdf2 8%, #7a96df 40%, #7590dc 100%);
}

.main-page:not(.is-active) .xp-title {
  color: #d8e4f8;
}

.xp-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-family: var(--ui-font);
  color: #ffffff;
  font-weight: bold;
  font-size: 0.85rem;
  text-shadow: 1px 1px #002375;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xp-icon {
  width: 16px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  background: #fff;
  flex-shrink: 0;
}

.xp-buttons {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.xp-btn {
  background: linear-gradient(to bottom, #eef3f7 0%, #c1d2e5 100%);
  border: 1px solid #003399;
  border-radius: 3px;
  width: 21px;
  height: 21px;
  font-size: 0.65rem;
  font-weight: bold;
  color: #002375;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 1px 1px #ffffff;
  padding: 0;
  margin: 0;
}

.xp-btn:hover {
  filter: brightness(1.08);
}

.xp-btn:active {
  filter: brightness(0.9);
}

.xp-btn.close {
  background: linear-gradient(to bottom, #e96f5b 0%, #d83018 100%);
  border: 1px solid #751400;
  color: #ffffff;
  box-shadow: inset 1px 1px #f4a094;
}

.window-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---------- Fenêtre principale ---------- */

.main-page .header {
  width: 100%;
  height: 100px;
  overflow: hidden;
  background: #000;
  border-bottom: 2px solid #000;
}

.header-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: scroll-strip 40s linear infinite;
}

.header:hover .header-track {
  animation-play-state: paused;
}

.main-page .header .img-header {
  height: 100px;
  width: 133px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

@keyframes scroll-strip {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.led-marquee {
  display: flex;
  overflow: hidden;
  white-space: nowrap;
  background: #050505;
  border-top: 1px solid #222;
  border-bottom: 2px inset #333;
  padding: 5px 0 3px;
  font-family: 'Ledlight', monospace;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--xp-green);
  text-shadow: 0 0 6px rgba(99, 219, 0, 0.8);
}

.led-marquee span {
  flex-shrink: 0;
  padding-right: 2em;
  animation: scroll-led 22s linear infinite;
}

@keyframes scroll-led {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.welcome-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  width: 100%;
  padding: 20px 16px 8px;
}

.main-page .title {
  font-family: 'Aero', var(--ui-font);
  font-weight: normal;
  color: var(--xp-green);
  font-size: clamp(2.6rem, 8vh, 5.5rem);
  line-height: 1;
  margin: 10px;
  text-shadow: 2px 2px 0 #2c7a00, 4px 4px 0 rgba(0, 0, 0, 0.15);
}

/* bouton XP classique */
.xp-button {
  display: inline-block;
  font-family: var(--ui-font);
  font-size: 13px;
  color: #000;
  text-decoration: none;
  padding: 4px 16px;
  min-width: 90px;
  text-align: center;
  border: 1px solid #003c74;
  border-radius: 3px;
  background: linear-gradient(to bottom, #ffffff 0%, #f6f6f3 40%, #ecebe6 85%, #d6d0c5 100%);
  box-shadow: inset -1px -1px 0 rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.xp-button:hover {
  box-shadow: inset 0 0 0 2px #f9b33b, inset 0 -2px 0 2px #e5a01a;
}

.xp-button:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

.xp-button:active {
  background: linear-gradient(to bottom, #dad3c9 0%, #e7e0d8 15%, #f2efe9 60%, #f6f6f6 100%);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 12px 20px 20px;
}

.xp-groupbox {
  margin: 0;
  padding: 8px 12px 12px;
  border: 1px solid #d0d0bf;
  border-radius: 4px;
  background: #fbfbf8;
}

.xp-groupbox legend {
  color: #0046d5;
  padding: 0 4px;
  font-weight: bold;
}

.xp-groupbox p {
  margin: 6px 0;
  line-height: 1.45;
}

.updates {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.updates li {
  padding: 5px 0;
  border-bottom: 1px dotted #ccc;
}

.updates li:last-child {
  border-bottom: 0;
}

.updates .date {
  display: inline-block;
  min-width: 44px;
  margin-right: 6px;
  padding: 1px 4px;
  font-family: 'Ledlight', monospace;
  font-size: 11px;
  text-align: center;
  color: var(--xp-green);
  background: #050505;
  border-radius: 2px;
}

.xp-statusbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding: 3px 8px;
  font-size: 11px;
  background: var(--xp-face);
  border-top: 1px solid #c5c2b2;
}

.status-zone {
  padding-left: 10px;
  border-left: 1px solid #c5c2b2;
}

/* ---------- Fenêtre gauche : volet de tâches XP ---------- */

.task-pane {
  background: linear-gradient(to bottom, #7ba2e7 0%, #6375d6 100%);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-group {
  background: #d6dff7;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.task-group-header {
  margin: 0;
  padding: 5px 10px;
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: bold;
  color: #215dc6;
  background: linear-gradient(to right, #ffffff 0%, #c6d3f7 100%);
}

.task-group.red .task-group-header {
  font-family: 'Aero', var(--ui-font);
  font-weight: normal;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(to right, #ff2a1a 0%, var(--nerv-red) 60%, #9e1200 100%);
  text-shadow: 1px 1px #5a0a00;
}

.task-group.red {
  background: #fff1ef;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 8px 10px;
}

.task-list li + li {
  margin-top: 6px;
}

.task-list a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #215dc6;
  text-decoration: none;
}

.task-group.red .task-list a {
  font-family: 'Aero', var(--ui-font);
  font-size: 14px;
  color: #000;
}

.task-list a:hover {
  text-decoration: underline;
  color: #428eff;
}

.task-group.red .task-list a:hover {
  color: var(--nerv-red);
}

.task-ico {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  font-family: var(--ui-font);
  font-size: 11px;
  color: #fff;
  background: linear-gradient(to bottom, #3a93ff, var(--xp-blue));
  border-radius: 3px;
  flex-shrink: 0;
}

.task-group.red .task-ico {
  background: linear-gradient(to bottom, #ff5a45, var(--nerv-red));
}

.task-details {
  padding: 8px 10px;
  font-size: 11px;
}

.task-details-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border: 1px solid #7a96df;
}

.task-details p {
  margin: 6px 0 0;
}

/* ---------- Fenêtre droite : chatbox ---------- */

.chat-content {
  display: flex;
  flex-direction: column;
  background: var(--xp-face);
  padding: 8px;
  gap: 6px;
}

.chat-banner {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
  border: 2px inset #fff;
  flex-shrink: 0;
}

.chat-hint {
  margin: 0;
  font-size: 11px;
  text-align: center;
  color: #444;
}

.chatbox {
  flex: 1;
  width: 100%;
  min-height: 260px;
  border: 2px inset #fff;
  background: #fff;
}

/* ---------- Barre des tâches ---------- */

.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-h);
  display: flex;
  align-items: stretch;
  background: linear-gradient(to bottom, #3168d5 0%, #4993e6 6%, #2157d7 12%, #2663e0 88%, #1941a5 100%);
  z-index: 100;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 22px 2px 12px;
  border: 0;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(to bottom, #3c9a3c 0%, #5dc35d 10%, #3c9a3c 50%, #2f8a2f 100%);
  box-shadow: inset -2px 0 3px rgba(0, 0, 0, 0.3), 2px 0 4px rgba(0, 0, 0, 0.35);
  font-family: 'Trebuchet MS', var(--ui-font);
  font-style: italic;
  font-weight: bold;
  font-size: 18px;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.start-btn::before {
  content: '';
  width: 18px;
  height: 18px;
  background:
    linear-gradient(#f35325, #f35325) 0 0 / 8px 8px no-repeat,
    linear-gradient(#81bc06, #81bc06) 10px 0 / 8px 8px no-repeat,
    linear-gradient(#05a6f0, #05a6f0) 0 10px / 8px 8px no-repeat,
    linear-gradient(#ffba08, #ffba08) 10px 10px / 8px 8px no-repeat;
  transform: skewY(-6deg);
}

.start-btn:hover,
.start-btn[aria-expanded="true"] {
  filter: brightness(1.1);
}

.start-menu {
  position: absolute;
  bottom: var(--taskbar-h);
  left: 0;
  width: 230px;
  background: #fff;
  border: 2px solid var(--xp-border);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.5);
}

.start-menu[hidden] {
  display: none;
}

.start-menu-header {
  padding: 10px 12px;
  font-family: 'Aero', var(--ui-font);
  font-size: 18px;
  color: #fff;
  background: linear-gradient(to bottom, #1868ce, #0e60cb 50%, #4c8fe6);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.start-menu a {
  display: block;
  padding: 8px 14px;
  color: #000;
  text-decoration: none;
}

.start-menu a:hover,
.start-menu a:focus-visible {
  background: #316ac5;
  color: #fff;
  outline: none;
}

.task-buttons {
  flex: 1;
  display: flex;
  gap: 3px;
  align-items: center;
  padding: 0 8px;
  min-width: 0;
  overflow: hidden;
}

.task-btn {
  flex: 0 1 160px;
  min-width: 0;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #1c3fa6;
  border-radius: 3px;
  background: linear-gradient(to bottom, #3c81f3 0%, #3176ec 50%, #2a69df 100%);
  box-shadow: inset 1px 1px rgba(255, 255, 255, 0.3);
  color: #fff;
  font: 11px var(--ui-font);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.task-btn.is-active {
  background: linear-gradient(to bottom, #1e4fb8 0%, #1b49ad 100%);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.task-btn.is-minimized {
  opacity: 0.75;
}

.tray {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: linear-gradient(to bottom, #0c59b9 0%, #139ee9 6%, #18b9ff 12%, #0f9be8 88%, #0d76d4 100%);
  border-left: 1px solid #092e72;
  box-shadow: inset 1px 0 1px #18b9ff;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

/* ---------- Page About me ---------- */

.about-window {
  width: min(720px, 100%);
  height: auto;
  max-height: 100%;
}

.about-content {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  padding: 20px;
}

.about-photo {
  width: 100%;
  border: 2px inset #fff;
  display: block;
}

.about-content .title {
  font-size: clamp(2rem, 6vh, 3.5rem);
  margin: 0 0 10px;
}

.about-content p {
  line-height: 1.5;
}

/* ---------- Responsive ---------- */

@media (max-width: 1250px) {
  .desktop-icons {
    display: none;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .desktop {
    height: auto;
    min-height: calc(100vh - var(--taskbar-h));
    flex-direction: column;
    align-items: stretch;
    padding: 16px 16px calc(var(--taskbar-h) + 16px);
  }

  .main-page,
  .main-page.left-window,
  .main-page.right-window {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: auto;
    max-height: none;
  }

  .center-window {
    order: -1;
  }

  .welcome-container .title {
    order: -1;
    width: 100%;
    text-align: center;
  }

  .center-window .window-content,
  .left-window .window-content {
    overflow: visible;
  }

  .chatbox {
    min-height: 360px;
  }

  .xp-btn[data-action="maximize"] {
    display: none;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-width: 220px;
    margin: 0 auto;
  }

  .tray {
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-track,
  .led-marquee span {
    animation: none;
  }
}
