@import url('coleurs.css');
@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

/* --- EFFET CRT GLOBAL --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
  z-index: 9998;
}

/* --- BODY --- */
body {
  margin: 0;
  font-family: 'Share Tech Mono', monospace;
  background-color: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: crtFlicker 8s infinite;
}

@keyframes crtFlicker {
  0%,  95%, 100% { opacity: 1; }
  96%            { opacity: 0.92; }
  97%            { opacity: 1; }
  98%            { opacity: 0.88; }
  99%            { opacity: 1; }
}

/* --- MAIN --- */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* --- FENETRE --- */
.window {
  width: 960px;
  max-width: 100%;
  height: 600px;
  max-height: 90vh;
  background-color: var(--color-card);
  border: 2px solid var(--color-neon);
  border-radius: 0;
  box-shadow:
    0 0 0 4px var(--color-bg),
    0 0 0 6px var(--color-neon),
    0 0 40px rgba(57, 255, 20, 0.3),
    0 0 80px rgba(57, 255, 20, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: crtTurnOn 1s ease forwards;
  position: relative;
}

@keyframes crtTurnOn {
  0%   { transform: scaleY(0.01) scaleX(1); opacity: 0.5; }
  30%  { transform: scaleY(0.01) scaleX(1); opacity: 1; }
  60%  { transform: scaleY(1) scaleX(1.05); }
  100% { transform: scaleY(1) scaleX(1); }
}

/* Scanline animée */
.window::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    transparent 50%,
    rgba(57, 255, 20, 0.02) 50%
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 10;
  animation: scanMove 6s linear infinite;
}

@keyframes scanMove {
  from { background-position: 0 0; }
  to   { background-position: 0 100%; }
}

/* --- BARRE DE TITRE --- */
.title-bar {
  height: 38px;
  background-color: var(--color-neon);
  display: flex;
  align-items: center;
  padding: 0 12px;
  justify-content: space-between;
  flex-shrink: 0;
}

.title-bar .buttons {
  display: flex;
  gap: 8px;
}

.title-bar .buttons span {
  width: 12px;
  height: 12px;
  border-radius: 0;
  display: inline-block;
  border: 1px solid var(--color-bg);
}

.btn-close { background: var(--color-glitch); }
.btn-min   { background: #ffbd2e; }
.btn-max   { background: var(--color-bg); }

.title-bar .title {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: var(--color-bg);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* --- CORPS --- */
.window-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
  width: 200px;
  background-color: var(--color-bg);
  border-right: 2px solid var(--color-neon);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar::before {
  content: '[ MENU ]';
  display: block;
  font-family: 'VT323', monospace;
  font-size: 18px;
  text-align: center;
  padding: 10px;
  color: var(--color-neon);
  letter-spacing: 4px;
  border-bottom: 1px solid var(--color-neon);
  text-shadow: 0 0 10px var(--color-neon);
}

.vm-item {
  padding: 13px 16px;
  cursor: pointer;
  color: var(--color-text-muted);
  font-family: 'VT323', monospace;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.1s ease;
  border-bottom: 1px solid rgba(57, 255, 20, 0.1);
  position: relative;
}

.vm-item::before {
  content: '>';
  position: absolute;
  left: 6px;
  color: var(--color-neon);
  opacity: 0;
  transition: opacity 0.1s;
  text-shadow: 0 0 8px var(--color-neon);
}

.vm-item:hover::before,
.vm-item.active::before {
  opacity: 1;
}

.vm-item:hover,
.vm-item.active {
  color: var(--color-neon);
  background: rgba(57, 255, 20, 0.07);
  text-shadow: 0 0 8px var(--color-neon);
  padding-left: 24px;
}

/* --- CONTENU --- */
.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--color-card);
}

.section { display: none; }

.section.active {
  display: block;
  animation: crtFadeIn 0.2s steps(4) forwards;
}

@keyframes crtFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- TITRES --- */
h2 {
  font-family: 'VT323', monospace;
  font-size: 28px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--color-neon);
  text-shadow: 0 0 12px var(--color-neon), 2px 2px 0 rgba(57, 255, 20, 0.2);
  border-bottom: 1px dashed var(--color-neon);
  padding-bottom: 6px;
  margin-bottom: 1.4rem;
  margin-top: 0;
}

/* --- COMPÉTENCES --- */
.skill-block {
  margin-bottom: 1.6rem;
}

.skill-label {
  display: flex;
  justify-content: space-between;
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: var(--color-text);
  margin-bottom: 4px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.skill-label span:last-child {
  color: var(--color-neon);
  text-shadow: 0 0 6px var(--color-neon);
}

.skill-bar {
  height: 14px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-neon);
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

/* Grille de blocs style vieux jeu */
.skill-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 18px,
    rgba(0, 0, 0, 0.4) 18px,
    rgba(0, 0, 0, 0.4) 20px
  );
  z-index: 2;
  pointer-events: none;
}

.skill-fill {
  height: 100%;
  background: var(--color-neon);
  box-shadow: 0 0 8px var(--color-neon), 0 0 20px rgba(57, 255, 20, 0.4);
  width: 0%;
  animation: fillBar 1.4s steps(20) forwards;
  animation-delay: 0.5s;
}

@keyframes fillBar {
  from { width: 0%; }
  to   { width: var(--skill-pct); }
}

/* --- LISTES --- */
ul { padding-left: 0; list-style: none; }

li {
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: var(--color-text);
  margin-bottom: 0.4rem;
  padding-left: 20px;
  position: relative;
  letter-spacing: 1px;
}

li::before {
  content: '*';
  position: absolute;
  left: 4px;
  color: var(--color-neon);
  text-shadow: 0 0 6px var(--color-neon);
}

/* --- LIEN CV --- */
a.cv-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 8px 20px;
  background: var(--color-neon);
  color: var(--color-bg);
  font-family: 'VT323', monospace;
  font-size: 20px;
  letter-spacing: 3px;
  text-decoration: none;
  border-radius: 0;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 rgba(57, 255, 20, 0.3);
  transition: all 0.1s steps(2);
}

a.cv-link:hover {
  background: var(--color-hover);
  box-shadow: 2px 2px 0 rgba(26, 255, 122, 0.3);
  transform: translate(2px, 2px);
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-neon);
  border-radius: 0;
  box-shadow: 0 0 6px var(--color-neon);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .window { flex-direction: column; height: auto; }
  .window-body { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 2px solid var(--color-neon);
  }
  .sidebar::before { display: none; }
  .vm-item {
    flex: 1;
    text-align: center;
    border-bottom: none;
    border-right: 1px solid rgba(57, 255, 20, 0.2);
    white-space: nowrap;
  }
  .vm-item:last-child { border-right: none; }
  .vm-item:hover, .vm-item.active { padding-left: 16px; }
  .vm-item::before { display: none; }
}

@media (max-width: 600px) {
  main { align-items: flex-start; padding-top: 80px; }
  .title-bar { flex-direction: column; height: auto; padding: 5px; gap: 5px; text-align: center; }
  .vm-item { padding: 10px; font-size: 16px; }
  .content { padding: 14px; }
  a.cv-link { display: block; width: 100%; text-align: center; box-sizing: border-box; }
}