/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background: #000;
  color: #fff;
  font-family: 'Courier New', monospace;
  margin: 0;
  padding: 40px;
  line-height: 1.6;
}

.lang-fr {
  display: none;
}

body.fr-mode .lang-fr {
  display: inline-block;
}

body.fr-mode .lang-en {
  display: none;
}
 
/** NAVIGATION **/

nav {
  margin-bottom: 50px;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 10px;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  color: #CF7AFF;
  text-decoration: none;
  margin-right: 25px;
  font-size: 0.9rem;
  transition: color 0.3s, text-shadow 0.3s;
}

nav a:hover {
  color: #fff;
  text-shadow: 0 0 8px #CF7AFF;
}

.nav-controls {
  display: flex;
  align-items: center;
}

.control-btn {
  font-size: 0.9rem;
  color: #E0E0E0;
  font-weight: 900;
  text-decoration: none;
  transition: color 0.3s, text-shadow 0.3s, transform 0.3s;
  cursor: pointer;
  padding: 5px;
  border: 1px solid transparent;
}

.control-btn:hover {
  color: #ff4444;
  text-shadow: 0 0 10px #ff4444;
  transform: scale(1.05);
}

/** TERMINAL LOADER **/

#loading-text {
  margin-bottom: 20px;
  color: #fff;
  font-size: 0.9rem;
}

/** SHARED CONTENT COMPONENTS **/

.prompt {
  color: #CF7AFF;
  font-weight: bold;
  font-size: 0.8rem;
}

.command {
  color: #fff;
  margin-bottom: 20px;
  font-size: 0.8rem;
}

.section {
  margin-bottom: 80px;
  display: none;
}

.title {
  color: #CF7AFF;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.section-block {
  margin-top: 20px;
  margin-bottom: 15px;
}

.skills-section {
  margin-top: 20px;
  margin-bottom: 15px;
}

.job-card {
  border-left: 2px solid #CF7AFF;
  padding-left: 20px;
  margin-bottom: 30px;
}

.job-company {
  font-weight: bold;
  color: #fff;
  font-size: 1.1rem;
}

.job-date {
  color: #666;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.job-desc {
  color: #ccc;
  margin-top: 5px;
  font-size: 0.95rem;
}

.passions-container {
  margin-top: 20px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.passion-tag {
  border: 1px solid #CF7AFF;
  color: #CF7AFF;
  padding: 5px 15px;
  font-size: 0.85rem;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.passion-tag:hover {
  background: #CF7AFF;
  color: #000;
}

.passion-tag.active {
  background: #CF7AFF;
  color: #000;
  box-shadow: 0 0 10px #CF7AFF;
}

#passion-description {
  margin-top: 20px;
  padding: 15px;
  border: 1px dashed #CF7AFF;
  background: rgba(207, 122, 255, 0.05);
  color: #ccc;
  font-size: 0.9rem;
  display: none;
  min-height: 50px;
}

/** ABOUT PAGE SPECIFIC **/

.about-container {
  max-width: 800px;
}

.bio-box {
  border-left: 2px solid #CF7AFF;
  padding-left: 20px;
  margin-bottom: 30px;
}

.bio-text {
  color: #ccc;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.bio-text strong {
  color: #CF7AFF;
}

.job-company.large {
  font-size: 1.2rem;
}

.job-desc.small {
  font-size: 0.85rem;
}

.status-line {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 10px;
}

.cv-button {
  display: inline-block;
  padding: 12px 25px;
  border: 1px solid #CF7AFF;
  color: #CF7AFF;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  transition: background 0.4s, color 0.4s, box-shadow 0.4s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cv-button:hover {
  background: #CF7AFF;
  color: #000;
  box-shadow: 0 0 15px rgba(207, 122, 255, 0.5);
}

#content {
  display: none;
  max-width: 1100px;
}

/** PROJECTS PAGE SPECIFIC **/

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.project-card {
  border: 1px solid #1a1a1a;
  padding: 20px;
  background: #050505;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  border-color: #CF7AFF;
  box-shadow: 0 0 15px rgba(207, 122, 255, 0.1);
  transform: translateY(-5px);
}

.project-status {
  font-size: 0.7rem;
  color: #CF7AFF;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.project-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 15px;
}

.project-desc {
  font-size: 0.85rem;
  color: #ccc;
  margin-bottom: 20px;
  min-height: 80px;
}

.tech-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tech-tag {
  font-size: 0.7rem;
  background: #1a1a1a;
  color: #CF7AFF;
  padding: 2px 8px;
  border-radius: 3px;
}

.project-link {
  display: block;
  margin-top: 20px;
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: bold;
  border-top: 1px solid #1a1a1a;
  padding-top: 15px;
}

.project-link:hover {
  color: #CF7AFF;
}

.ctf-zone {
  margin-top: 100px;
  text-align: center;
  border-top: 1px dashed #1a1a1a;
  padding-top: 40px;
}

.ctf-btn {
  background: transparent;
  border: 1px solid #CF7AFF;
  color: #CF7AFF;
  padding: 10px 20px;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  transition: background 0.1s ease;
  position: relative;
  z-index: 100;
}

.ctf-btn:hover {
  background: rgba(207, 122, 255, 0.1);
}

.flag-display {
  display: none;
  margin-top: 20px;
  color: #00ff00;
  font-family: monospace;
  font-weight: bold;
}

.flag-display .flag-label {
  color: #CF7AFF;
}

/** WRONGWAY PAGE SPECIFIC **/

body.page-wrongway {
  padding: 40px;
  height: 100vh;
  overflow: hidden;
}

.wrongway-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wrongway-glitch-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.status-code {
  font-weight: 900;
  font-size: 1.5rem;
  position: relative;
  color: #ffffff;
  display: inline-block;
}

.status-code::before,
.status-code::after {
  content: "ERROR_CODE: WRONG_WAY";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
}

.status-code::before {
  left: 2px;
  text-shadow: -1px 0 #CF7AFF;
  clip: rect(10px, 9999px, 20px, 0);
  animation: glitch-anim-sm 2s infinite linear alternate-reverse;
}

.status-code::after {
  left: -2px;
  text-shadow: 1px 0 #ffffff;
  clip: rect(25px, 9999px, 35px, 0);
  animation: glitch-anim-sm 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-sm {
  0%   { clip: rect(5px,  9999px, 15px, 0); transform: skew(0.2deg); }
  50%  { clip: rect(20px, 9999px, 30px, 0); transform: skew(-0.2deg); }
  100% { clip: rect(10px, 9999px, 25px, 0); transform: skew(0.1deg); }
}

.log-entry {
  font-size: 0.85rem;
  letter-spacing: 1px;
  opacity: 0.7;
  white-space: pre;
}

.back-link {
  color: #ffffff;
  text-decoration: none;
  margin-top: 40px;
  display: inline-block;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
  width: fit-content;
}

.back-link:hover {
  background: #ffffff;
  color: #000000;
}

/** BETHESAVIOR PAGE SPECIFIC **/

body.page-bethesavior {
  padding: 0;
  color: #CF7AFF;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.login-box {
  border: 1px solid #CF7AFF;
  padding: 30px;
  box-shadow: 0 0 15px rgba(207, 122, 255, 0.2);
  width: 350px;
}

.login-box h2 {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 25px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 5px;
}

.input-group input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #fff;
  padding: 10px;
  box-sizing: border-box;
  outline: none;
  font-family: 'Courier New', monospace;
}

.input-group input:focus {
  border-color: #CF7AFF;
}

.login-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid #CF7AFF;
  color: #CF7AFF;
  cursor: pointer;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  transition: background 0.3s, color 0.3s;
}

.login-btn:hover {
  background: #CF7AFF;
  color: #000;
}

#error-msg {
  color: #ff4444;
  font-size: 0.75rem;
  margin-top: 15px;
  text-align: center;
  display: none;
}

/** INDEX (404) PAGE SPECIFIC **/

body.page-index {
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 0;
}

.corner {
  position: absolute;
  padding: 40px;
  font-size: 1rem;
  letter-spacing: -1px;
}

.top-left {
  top: 0;
  left: 0;
}

.top-left a {
  color: #ffffff;
  text-decoration: none;
  padding: 5px 10px;
  transition: color 0.3s;
}

.top-right {
  top: 0;
  right: 0;
  font-size: 3rem;
  color: #ffffff;
  opacity: 1;
  font-weight: 900;
}

.bottom-left {
  bottom: 0;
  left: 0;
  color: #fff;
  text-decoration: none;
  font-weight: normal;
}

/* Fix: force le lien enfant à hériter du style du parent */
.bottom-left a {
  color: #ffffff;
  text-decoration: none;
}

.bottom-left:hover {
  color: #fff;
  text-shadow: none;
}

.bottom-right {
  bottom: 0;
  right: 0;
  color: #CF7AFF;
}

.glitch-wrapper {
  text-align: center;
  position: relative;
}

.glitch {
  font-size: 8rem;
  font-weight: 900;
  margin: 0;
  position: relative;
  color: #ffffff;
  letter-spacing: -5px;
}

.glitch::before,
.glitch::after {
  content: "404 ERROR";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  clip: rect(0, 900px, 0, 0);
}

.glitch::before {
  clip: rect(44px, 9999px, 56px, 0);
  left: -2px;
  text-shadow: -2px 0 #CF7AFF;
  animation: glitch-anim 2s infinite linear alternate-reverse;
}

.glitch::after {
  clip: rect(44px, 9999px, 56px, 0);
  left: -2px;
  text-shadow: -2px 0 #ffffff;
  animation: glitch-anim 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0%   { clip: rect(10px, 9999px, 20px, 0); transform: skew(0.5deg); }
  20%  { clip: rect(30px, 9999px, 40px, 0); transform: skew(-0.5deg); }
  40%  { clip: rect(60px, 9999px, 70px, 0); transform: skew(0.8deg); }
  60%  { clip: rect(15px, 9999px, 25px, 0); transform: skew(-0.2deg); }
  80%  { clip: rect(80px, 9999px, 90px, 0); transform: skew(0.4deg); }
  100% { clip: rect(45px, 9999px, 55px, 0); transform: skew(-0.8deg); }
}

.status-text {
  font-size: 1rem;
  color: #CF7AFF;
  letter-spacing: -1px;
  margin-top: -10px;
}

.status-link {
  color: #CF7AFF;
  text-decoration: none;
  font-weight: normal;
}

.status-link:hover {
  color: #CF7AFF;
  text-shadow: none;
}

/** SECRET ARCHIVE (VICTORY) PAGE SPECIFIC **/

body.page-victory {
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 0;
}
 
body.page-victory::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 100, 0.015) 2px,
    rgba(0, 255, 100, 0.015) 4px
  );
  pointer-events: none;
  z-index: 0;
}
 
.victory-wrapper {
  text-align: center;
  position: relative;
  z-index: 1;
  animation: fadeIn 1.2s ease forwards;
}
 
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
 
.system-status {
  font-size: 0.8rem;
  color: #00ff64;
  letter-spacing: 3px;
  margin-bottom: 10px;
  opacity: 0;
  animation: fadeIn 0.8s ease 0.4s forwards;
}
 
.victory-title {
  font-size: 5rem;
  font-weight: 900;
  color: #00ff64;
  letter-spacing: -3px;
  margin: 0;
  text-shadow: 0 0 30px rgba(0, 255, 100, 0.5), 0 0 60px rgba(0, 255, 100, 0.2);
  opacity: 0;
  animation: fadeIn 0.8s ease 0.8s forwards;
}
 
.victory-sub {
  font-size: 1rem;
  color: #fff;
  letter-spacing: 2px;
  margin-top: 10px;
  opacity: 0;
  animation: fadeIn 0.8s ease 1.2s forwards;
}
 
.divider {
  width: 300px;
  height: 1px;
  background: linear-gradient(to right, transparent, #00ff64, transparent);
  margin: 30px auto;
  opacity: 0;
  animation: fadeIn 0.8s ease 1.5s forwards;
}
 
.flag-box {
  border: 1px solid #00ff64;
  padding: 20px 40px;
  display: inline-block;
  box-shadow: 0 0 20px rgba(0, 255, 100, 0.15), inset 0 0 20px rgba(0, 255, 100, 0.03);
  opacity: 0;
  animation: fadeIn 0.8s ease 1.8s forwards;
}
 
.flag-label {
  font-size: 0.7rem;
  color: #00ff64;
  letter-spacing: 3px;
  margin-bottom: 10px;
  display: block;
}
 
.flag-value {
  font-size: 1.1rem;
  font-weight: bold;
  color: #ffffff;
  letter-spacing: 1px;
}
 
.log-lines {
  margin-top: 40px;
  font-size: 0.75rem;
  color: #444;
  line-height: 2;
  opacity: 0;
  animation: fadeIn 0.8s ease 2.2s forwards;
}
 
.log-lines span {
  display: block;
}
 
.log-lines .ok {
  color: #00ff64;
}
 
.corner-tl {
  position: fixed;
  top: 40px;
  left: 40px;
  font-size: 0.8rem;
  color: #00ff64;
  opacity: 0;
  animation: fadeIn 0.8s ease 2.5s forwards;
}
 
.corner-br {
  position: fixed;
  bottom: 40px;
  right: 40px;
  font-size: 0.8rem;
  color: #333;
  opacity: 0;
  animation: fadeIn 0.8s ease 2.5s forwards;
}
 
.back-home {
  display: inline-block;
  margin-top: 35px;
  color: #00ff64;
  text-decoration: none;
  font-size: 0.8rem;
  border: 1px solid #00ff64;
  padding: 8px 20px;
  transition: background 0.3s, color 0.3s;
  opacity: 0;
  animation: fadeIn 0.8s ease 2.8s forwards;
}
 
.back-home:hover {
  background: #00ff64;
  color: #000;
}

/** HINT BUTTON (index page) **/

.hint-btn {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #CF7AFF;
  background: #000;
  color: #CF7AFF;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s;
  z-index: 50;
}

.hint-btn:hover {
  background: rgba(207, 122, 255, 0.1);
  box-shadow: 0 0 12px rgba(207, 122, 255, 0.4);
}

.hint-popup {
  position: fixed;
  right: 75px;
  top: 50%;
  transform: translateY(-50%);
  background: #0a0a0a;
  border: 1px solid #CF7AFF;
  box-shadow: 0 0 20px rgba(207, 122, 255, 0.15);
  padding: 18px 22px;
  width: 300px;
  font-size: 0.8rem;
  z-index: 51;
  display: none;
}

.hint-popup.visible {
  display: block;
  animation: fadeIn 0.2s ease forwards;
}

.hint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.hint-title {
  color: #CF7AFF;
  font-weight: bold;
  margin: 0;
  letter-spacing: 1px;
}

.hint-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hint-nav {
  color: #CF7AFF;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: color 0.2s, text-shadow 0.2s;
  user-select: none;
}

.hint-nav:hover {
  color: #fff;
  text-shadow: 0 0 8px #CF7AFF;
}

.hint-close {
  color: #ff4444;
  cursor: pointer;
  font-size: 0.75rem;
  transition: color 0.2s;
  user-select: none;
}

.hint-close:hover {
  color: #ff4444;
}

.hint-text {
  color: #ccc;
  margin: 0 0 10px 0;
  line-height: 1.6;
}

.hint-text-a {
  color: #ccc;
  margin: 0 0 10px 0;
  line-height: 1.6;
}

.hint-counter {
  color: #CF7AFF;
  font-size: 0.7rem;
  margin: 0;
  text-align: right;
  letter-spacing: 1px;
}

/** PROJECTS SOLAR SYSTEM **/

#solar-layout {
  display: flex;
  height: calc(100vh - 160px);
  min-height: 400px;
  position: relative;
}

#solar-canvas {
  flex: 0 0 60%;
  width: 60%;
  height: 100%;
  display: block;
  background: #000;
}

#project-panel {
  flex: 0 0 40%;
  width: 40%;
  height: 100%;
  background: transparent;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#project-panel.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#project-panel .project-card {
  width: 100%;
  max-width: 340px;
  border-color: rgba(207, 122, 255, 0.3) !important;
  box-shadow: 0 0 16px rgba(207, 122, 255, 0.12);
}

/* Responsive */
@media (max-width: 900px) {
  #solar-layout {
    flex-direction: column;
    height: auto;
  }
  #solar-canvas {
    flex: none;
    width: 100%;
    height: 55vw;
    min-height: 300px;
  }
  #project-panel {
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 16px;
    justify-content: flex-start;
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 480px) {
  #solar-canvas { height: 70vw; min-height: 260px; }
}
