/* --- VARIABLES --- */
:root {
  --bg-main: #0d1117;
  --bg-card: #161b22;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;

  --accent: #58a6ff;
  --keyword: #ff7b72;
  --string: #a5d6ff;
  --purple: #bc8cff;
  --border: #30363d;

  --success: #27ae60;
  --error: #ca6956;

  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

/* --- LAYOUT UTILS --- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding-top: 100px;
}

h1,
h2,
h3 {
  margin-bottom: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.2s;
}
a:hover {
  color: var(--accent);
}

/* --- HEADER --- */
header {
  position: fixed; /* Fixe la navbar en haut */
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(13, 17, 23, 0.9); /* Fond semi-transparent */
  backdrop-filter: blur(10px); /* Effet de flou */
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 15px 0;
}

/* Conteneur interne pour aligner le contenu du header avec le reste du site */
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  z-index: 101;
}
.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 30px;
  align-items: center;
  transition: 0.3s ease-in-out;
}
.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.nav-links a:hover {
  color: var(--text-primary);
}
.nav-links span.num {
  color: var(--accent);
  margin-right: 5px;
  opacity: 0.6;
}

/* Burger Menu (Hidden on Desktop) */
.burger {
  display: none;
  cursor: pointer;
  z-index: 101;
}
.burger div {
  width: 25px;
  height: 2px;
  background-color: var(--text-primary);
  margin: 5px;
  transition: 0.3s;
}

/* Language Selector */
.lang-selector {
  display: flex;
  gap: 15px;
  margin-left: 20px;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}
.lang-btn {
  cursor: pointer;
  opacity: 0.5;
  transition: 0.3s;
  font-size: 1.2rem;
  filter: grayscale(100%);
}
.lang-btn:hover,
.lang-btn.active {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.1);
}

/* --- HERO --- */
.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-top: 140px;
}

.intro-comment {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 20px;
  font-style: italic;
}

.hero h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  background: linear-gradient(90deg, #fff, #8b949e);
  margin-bottom: 30px;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
}

.hero p span {
  color: var(--text-primary);
}

.hero-desc {
  max-width: 500px;
  font-size: 1.1rem;
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 3.5rem;
  background-color: var(--accent);
  margin-left: 10px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

/* --- TECH MARQUEE (Scrolling Bar) --- */
.marquee-container {
  width: 100vw;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 30px 0;
  overflow: hidden;
  margin-top: 100px;
  margin-left: calc(50% - 50vw);
  margin-bottom: 50px;
}

.marquee-track {
  display: flex;
  gap: 80px;
  width: max-content;
  animation: scroll 20s linear infinite;
}

.tech-icon {
  height: 40px;
  width: auto;
  fill: #fff;
  opacity: 0.8;
  transition: 0.3s;
}
.tech-icon:hover {
  opacity: 1;
  fill: var(--accent);
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-100% / 2));
  }
}

/* --- SECTIONS --- */
.section-label {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 40px;
  display: block;
  font-weight: bold;
}

/* --- ABOUT / PRESENTATION --- */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-layout h2 {
  font-size: 2.5rem;
  line-height: 1.2;
}

.about-layout .subtitle {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 25px;
}

.about-layout p span {
  color: var(--accent);
}

/* Profile Image Styles */
.profile-container {
  margin: 60px 0;
  position: relative;
  max-width: 300px;
  z-index: 1;
}

.profile-container::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 20px;
  left: 20px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  z-index: -1;
  transition: 0.3s ease-in-out;
}

.profile-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background-color: var(--bg-card);
  display: block;
  filter: grayscale(0%);
  transition: 0.3s ease-in-out;
}

.profile-container:hover .profile-img {
  transform: translate(-5px, -5px);
}
.profile-container:hover::after {
  transform: translate(5px, 5px);
}

/* --- TECH STACK --- */
.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.tech-badge {
  background: rgba(56, 139, 253, 0.1);
  color: var(--accent);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: 0.3s;
}
.tech-badge:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

#stack h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.skills-container {
  max-width: 1024px;
  width: 100%;
  display: grid;
  grid-column-gap: 2rem;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 30px;
}

.skills-card {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  color: var(--text-primary);
}

.skills-icon-container {
  margin: 0 auto;
}

.skills-icon-container div {
  margin: 20px auto;
  padding: 24px;
}

.skills-icon-container img {
  transform: scale(2);
}

.skills-title {
  margin: 0 0 20px 0;
  text-align: center;
}

/* --- PROJECTS --- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.project-item {
  border-top: 1px solid var(--border);
  padding-top: 40px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
  transition: 0.3s;
}

.project-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.project-year {
  color: var(--keyword);
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}

.project-content h3 {
  margin-bottom: 10px;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.project-content .tech-badge {
  font-size: 0.8rem;
  padding: 4px 10px;
}

.link-arrow {
  display: inline-block;
  margin-top: 10px;
  font-weight: bold;
}

/* --- EDUCATION / TIMELINE --- */
.timeline {
  position: relative;
  border-left: 2px solid var(--border);
  margin-left: 10px;
  padding-left: 30px;
  margin-top: 20px;
}
.timeline-item {
  margin-bottom: 40px;
  position: relative;
}
.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -37px;
  top: 5px;
  width: 12px;
  height: 12px;
  background: var(--bg-main);
  border: 2px solid var(--purple);
  border-radius: 50%;
  transition: 0.3s;
}
.timeline-item:hover .timeline-dot {
  background: var(--purple);
  box-shadow: 0 0 10px rgba(188, 140, 255, 0.4);
}

.timeline-date {
  color: var(--purple);
  font-size: 0.9rem;
  margin-bottom: 5px;
  font-weight: bold;
  display: inline-block;
}
.timeline-title {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 5px;
}
.timeline-school {
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-style: italic;
  font-size: 0.95rem;
}

/* --- CONTACT --- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

.contact-layout h2 {
  font-size: 2rem;
}

form div {
  margin-bottom: 25px;
}

form div label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: 0.3s;
}

.form-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 12px 30px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 20px;
  transition: 0.3s;
}

.btn:hover {
  background: rgba(56, 139, 253, 0.1);
}

/* --- ARTICLE --- */
#article .article-header {
  padding-top: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
}

#article .meta-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
#article .meta-tag {
  color: var(--accent);
}

#article .article-header h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 30px;
  background: linear-gradient(90deg, #fff, #8b949e);
  background-clip: initial;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#article .content {
  margin-bottom: 100px;
}

#article .content h1 {
  margin-top: 50px;
  margin-bottom: 20px;
  font-size: 1.8rem;
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
  padding-left: 15px;
}

#article .content h2 {
  margin-top: 30px;
  margin-bottom: 15px;
  font-size: 1.4rem;
  color: var(--text-primary);
}

#article .content p,
#article .content div {
  display: inline;
  margin-bottom: 25px;
  color: #c9d1d9;
}

#article .content ul {
  margin-bottom: 25px;
  padding-left: 20px;
  color: #c9d1d9;
}

#article .content ol {
  margin-bottom: 25px;
  padding-left: 33px;
  color: #c9d1d9;
}
#article .content li {
  margin-bottom: 10px;
}
#article .content li::marker {
  color: var(--accent);
}

#article .content a {
  color: var(--accent);
  font-weight: bold;
}

#article .content a:hover {
  text-decoration: underline;
}

#article .content strong {
  color: var(--text-primary);
  font-weight: bold;
}

#article .content blockquote {
  margin: 40px 0;
  padding: 30px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-style: italic;
  text-align: center;
  position: relative;
  font-size: 1.1rem;
}

#article .content blockquote::before {
  content: "“";
  display: block;
  font-size: 4rem;
  line-height: 1;
  color: var(--accent);
  font-family: serif;
  opacity: 0.8;
}

#article .back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 20px;
  color: var(--accent);
  font-weight: bold;
  font-size: 0.9rem;
}
#article .back-link:hover {
  text-decoration: underline;
}

/* --- IMAGES (FIGURE) --- */
#article .content figure {
  margin: 40px 0;
  text-align: center;
}
#article .content figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}
#article .content figcaption {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
}

/*----- Error form -----*/

.alert-flash {
  min-width: 250px;
  color: #fff;
  border-radius: 0.5rem;
  padding: 16px;
  position: fixed;
  z-index: 1000;
  top: 90px;
  left: 30px;
  -webkit-animation:
    fadein 1s,
    fadeout 1s 5s forwards;
  animation:
    fadein 1s,
    fadeout 1s 5s forwards;
}

form li,
.alert-error {
  color: var(--error);
  font-size: 12px;
  list-style-type: none;
}

.alert-success {
  color: var(--success);
  font-size: 12px;
}

.alert-bg-error {
  background-color: var(--error);
}

.alert-bg-success {
  background-color: var(--success);
}

.alert-border {
  border-bottom: 3px solid var(--error);
}

/* --- FOOTER --- */
footer {
  margin-top: 100px;
  padding: 80px 0;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
}

/* --- ANIMATIONS --- */
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@-webkit-keyframes fadein {
  from {
    top: 70px;
    opacity: 0;
  }
  to {
    top: 90px;
    opacity: 1;
  }
}

@keyframes fadein {
  from {
    top: 70px;
    opacity: 0;
  }
  to {
    top: 90px;
    opacity: 1;
  }
}

@-webkit-keyframes fadeout {
  from {
    top: 90px;
    opacity: 1;
  }
  to {
    top: 70px;
    opacity: 0;
  }
}

@keyframes fadeout {
  from {
    top: 90px;
    opacity: 1;
  }
  to {
    top: 70px;
    opacity: 0;
  }
}

/* --- 404 ERROR PAGE --- */
.page-error {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  position: relative;
  overflow: hidden;
}

.page-error::before {
  content: "404";
  position: absolute;
  font-size: clamp(200px, 40vw, 400px);
  font-weight: 700;
  color: var(--bg-card);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  user-select: none;
  pointer-events: none;
  letter-spacing: -20px;
}

.page-error .error-container {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 600px;
}

.page-error .error-code {
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  animation: glitch 4s infinite;
  position: relative;
}

.page-error .error-code::before,
.page-error .error-code::after {
  content: "404";
  position: absolute;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--keyword), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-error .error-code::before {
  animation: glitch-top 4s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.page-error .error-code::after {
  animation: glitch-bottom 4s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

.page-error .error-title {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.page-error .error-message {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 40px;
  line-height: 1.8;
}

@keyframes glitch {
  0%, 90%, 100% { transform: none; }
  92% { transform: skewX(2deg) translateX(-3px); }
  94% { transform: skewX(-2deg) translateX(3px); }
  96% { transform: skewX(1deg) translateX(-2px); }
  98% { transform: skewX(-1deg) translateX(2px); }
}

@keyframes glitch-top {
  0%, 90%, 100% { transform: none; opacity: 0; }
  91% { transform: translateX(-4px); opacity: 0.7; }
  93% { transform: translateX(4px); opacity: 0.7; }
  95% { opacity: 0; }
}

@keyframes glitch-bottom {
  0%, 90%, 100% { transform: none; opacity: 0; }
  92% { transform: translateX(4px); opacity: 0.7; }
  94% { transform: translateX(-4px); opacity: 0.7; }
  96% { opacity: 0; }
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 768px) {
  section {
    padding-top: 60px;
  }

  /* Burger Menu */
  .burger {
    display: block;
  }

  /* Navigation Mobile */
  .nav-links {
    position: fixed;
    right: 0px;
    top: 0px;
    height: 100vh;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70%;
    transform: translateX(100%);
    border-left: 1px solid var(--border);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    gap: 30px;
  }
  .nav-links.nav-active {
    transform: translateX(0%);
  }

  /* Language Selector Mobile Adjustment */
  .lang-selector {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    margin-top: 20px;
  }

  /* Typography & Hero */
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero-desc {
    font-size: 1rem;
  }
  .cursor {
    height: 2.2rem;
  }

  .marquee-container {
    margin-top: 50px;
  }

  /* Presentation Grid */
  .about-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* Skills Grid */
  .skills-container {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Projects */
  .project-item {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .project-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
  }
  .project-year {
    display: inline;
    margin-bottom: 0;
  }

  /* Contact */
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* Footer */
  footer {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    margin-top: 50px;
  }
  footer div a {
    margin: 0 10px;
    margin-left: 0 !important;
  }

  /* Burger Animation Classes */
  .toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
  }
  .toggle .line2 {
    opacity: 0;
  }
  .toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
  }
}
