:root {
  /* --- COULEURS THEME CLAIR (Défaut) --- */
  --bg-color: #f5f6fa;
  --text-color: #2f3640;
  --primary-color: #6c5ce7;
  --header-bg: linear-gradient(260deg, #6c5ce7, #6d76ce);
  --accent-color: #00cec9;
  --accent-hover: #019a9a;

  --card-bg: white;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --card-hover-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);

  --tech-bg: #f5f6fa;
  --footer-bg: #2d3436;

  --input-bg: white;
  --input-border: #ccc;

  --wait-bg: rgba(255, 255, 255, 0.7);
  --wait-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);

  --featured-card-bg: #f0f3ff;
  --nav-link-color: white;
  --nav-link-hover: #fdcb6e;
}

/* --- COULEURS THEME SOMBRE --- */
html.dark-mode {
  --bg-color: #0e1225;
  --text-color: #eaeaea;
  --header-bg: linear-gradient(180deg, #2e2163, #0e1225);

  --card-bg: #2c2c3a;
  --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  --card-hover-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);

  --tech-bg: #3d3d4f;
  --footer-bg: #111;

  --input-bg: #2c2c3a;
  --input-border: #444;

  --wait-bg: rgba(44, 44, 58, 0.8);
  --wait-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

  --featured-card-bg: #2c2c3a;
}

/* --- RESET & GLOBAL --- */
html {
  scroll-behavior: smooth;
}

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

body {
  font-family: "Montserrat", sans-serif;
  line-height: 1.6;
  background: var(--bg-color);
  color: var(--text-color);
  transition:
    background 0.3s,
    color 0.3s;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.no-scroll {
  overflow: hidden !important;
  height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- HEADER & NAV --- */
header {
  background: var(--header-bg);
  color: white;
  text-align: center;
  transition: background 0.3s;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  flex-wrap: wrap;
  position: relative;
}

.navbar .logo {
  font-size: 1.8rem;
  font-weight: bold;
}

.logo-container {
  position: relative;
  width: 3.75rem;
}

.logo-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 4rem;
  width: auto;
  max-width: none;
  z-index: 100;
}

.navbar .logo span {
  color: var(--accent-color);
}

.burger-menu {
  display: none;
  cursor: pointer;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--nav-link-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--nav-link-hover);
}

html.dark-mode .nav-links a:hover {
  color: var(--accent-color);
}

/* --- TOGGLE SWITCH --- */
.toggle {
  position: relative;
  display: inline-block;
  width: 3.75rem;
  height: 2rem;
}

.toggle input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 62.43rem;
  transition: background 0.4s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.375rem;
}

.slider::before {
  content: "";
  position: absolute;
  height: 1.5rem;
  width: 1.5rem;
  left: 0.25rem;
  bottom: 0.25rem;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.4s;
}

.icon {
  width: 1.125rem;
  height: 1.125rem;
  color: #fff;
  z-index: 1;
}

.sun {
  color: #f39c12;
}

.moon {
  color: #2980b9;
}

.toggle input:checked + .slider {
  background: #2d3436;
}

.toggle input:checked + .slider::before {
  transform: translateX(1.75rem);
}

/* --- HERO SECTIONS --- */
h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.title {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-color);
}

.hero,
.hero-project {
  padding: 3rem 1rem;
}

.hero span,
.hero-project span {
  color: #fff3b1;
}

.hero p,
.hero-project p {
  margin-bottom: 1rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- MAIN STRUCTURE --- */
main {
  flex: 1 0 auto;
  width: 100%;
}

main section {
  padding: 3rem 1rem;
  max-width: 70rem;
  margin: auto;
  text-align: center;
}

main > div {
  margin: 2rem;
}

main > div p {
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

/* --- ABOUT SECTION --- */
.about {
  display: flex;
  gap: 2rem;
  padding: 0 1rem;
  margin-top: 3rem;
  margin-bottom: 3rem;
  align-items: center;
}

.desc {
  width: 50%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.desc p {
  margin-bottom: 1rem;
}

.picture {
  min-height: 25rem;
  background-image: url(assets/moi.jpg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  justify-content: center;
  width: 50%;
  border-radius: 10px;
}

/* --- NEWS & CARDS --- */
.news {
  text-align: center;
  padding: 0;
}

.more {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.more a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.more p {
  margin: 0;
}

.chevron {
  width: 1.5rem;
  height: auto;
}

html.dark-mode .chevron {
  filter: invert(1);
}

.cards-container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.cards-container h3 {
  margin-bottom: 1rem;
}

.card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  width: 100%;
  max-width: 20rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  margin: 0 auto;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--card-hover-shadow);
}

html.dark-mode .logo_atelier {
  background: #ffffff;
  border-radius: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
}

/* --- BENTO GRID PROJECTS --- */
.projects {
  padding: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 1.5rem;
  padding: 0 1rem;
  grid-auto-flow: dense;
}

.project-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.3s,
    background 0.3s,
    color 0.3s,
    opacity 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

html.dark-mode .project-card {
  box-shadow: var(--card-shadow);
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card.hide {
  display: none;
}

.project-card:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
  background-color: var(--featured-card-bg);
}

.project-card:nth-child(6) {
  grid-column: span 2;
}

/* --- SKILLS --- */
.skills ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0;
}

.skills li {
  background: #dfe6e9;
  padding: 0.7rem 1.2rem;
  border-radius: 25px;
  font-weight: 500;
  list-style: none;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
  cursor: pointer;
}

html.dark-mode .skills li:not(.active) {
  background: var(--tech-bg);
  color: var(--text-color);
}

.skills li:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  background: #b2bec3;
}

.skills li.active {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 10px rgba(0, 206, 201, 0.4);
}

/* --- BUTTONS & MISC --- */
.btn {
  margin-top: 1rem;
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s;
  cursor: pointer;
  font-weight: 500;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-color);
  color: white;
}

.freelance-content p {
  margin-bottom: 1rem;
}

/* --- PROJECT PAGE SPECIFIC --- */
.detail-section {
  padding: 2rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.row-layout {
  flex-direction: row;
}

.content-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  text-align: left;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

html.dark-mode .content-card {
  box-shadow: var(--card-shadow);
}

.content-card h2 {
  margin-top: 0;
  text-align: left;
}

.full-width {
  width: 100%;
}

.half-width {
  flex: 1;
  min-width: 18.75rem;
}

.tech-list {
  list-style: none;
  padding: 0;
}

.tech-list li {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  background: var(--tech-bg);
  padding: 0.8rem;
  border-radius: 8px;
  transition:
    transform 0.2s,
    background 0.3s;
}

.tech-list li:hover {
  transform: translateX(5px);
}

.tech-icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  margin-right: 1rem;
}

.styled-list {
  list-style: none;
}

.styled-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
}

.styled-list li::before {
  content: "•";
  color: var(--primary-color);
  font-weight: bold;
  position: absolute;
  left: 0;
  font-size: 1.2rem;
  line-height: 1.5rem;
}

.center-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.caption {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--primary-color);
  font-style: italic;
  text-align: center;
}

/* --- WAIT SCREEN SPECIFIC --- */
.wait-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  padding: 2rem 1rem;
}

.containerwait {
  background: var(--wait-bg);
  padding: 3rem 4rem;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: var(--wait-shadow);
  text-align: center;
  margin-bottom: 2rem;
  max-width: 37.5rem;
  width: 90%;
  animation: fadeIn 0.8s ease-out;
  transition:
    background 0.3s,
    box-shadow 0.3s;
}

.containerwait h1 {
  margin-bottom: 1rem;
  font-size: 3rem;
  color: var(--primary-color);
}

.containerwait p {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.sticker img {
  width: 100%;
  max-width: 9.375rem;
  height: auto;
  animation: float 3s ease-in-out infinite;
}

/* --- FORMULAIRE DE CONTACT --- */
.contact-form {
  max-width: 37.5rem;
  margin: 2rem auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-form label {
  font-weight: 600;
  margin-left: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  font-family: inherit;
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--text-color);
  transition:
    border-color 0.3s,
    box-shadow 0.3s,
    background 0.3s,
    color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

html.dark-mode .contact-form input:focus,
html.dark-mode .contact-form textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 206, 201, 0.2);
}

.contact-form button {
  align-self: center;
  border: none;
  font-size: 1rem;
  width: 100%;
  max-width: 12.5rem;
}

.gotcha-input {
  display: none;
}

/* --- DISCORD MOCKUP SPECIFIC --- */
.discord-mockup {
  background: #36393f;
  color: #dcddde;
  font-family: "Whitney", "Helvetica Neue", Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2rem;
  gap: 1.5rem;
  height: auto;
  border: none;
  border-radius: 8px;
}

.discord-msg {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  width: 100%;
  text-align: left;
}

.discord-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.discord-avatar.user {
  background-color: #5865f2;
}

.discord-avatar.bot {
  background-color: #00cec9;
}

.discord-content {
  display: flex;
  flex-direction: column;
}

.discord-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.discord-username {
  font-weight: bold;
  color: white;
  font-size: 1rem;
}

.discord-badge {
  font-size: 0.625rem;
  background: #5865f2;
  color: white;
  padding: 0.15rem 0.275rem;
  border-radius: 3px;
  line-height: 1;
}

.discord-date {
  font-size: 0.75rem;
  color: #72767d;
  margin-left: 0.2rem;
}

.discord-text {
  margin: 0;
  line-height: 1.375rem;
  color: #dcddde;
}

.discord-divider {
  width: 100%;
  height: 1px;
  background-color: #4f545c;
  margin: 0.5rem 0;
  opacity: 0.4;
}

/* --- FOOTER --- */
footer {
  text-align: center;
  padding: 1.5rem;
  background: var(--footer-bg);
  color: white;
  font-size: 0.9rem;
  transition: background 0.3s;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 99;
  width: 100%;
  margin-top: auto;
}

.footer-legal {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.footer-legal a {
  text-decoration: underline;
}

.Socialmedia {
  margin-top: 1rem;
  gap: 2rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.Socialmedia svg {
  mix-blend-mode: normal;
}

/* --- ANIMATION SCROLL REVEAL --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.5, 0, 0, 1);
  transition-delay: var(--delay, 0s);
  will-change: opacity, transform;
}

.reveal.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- STYLES LOGOS PROJETS --- */
.project-logo,
.logo_atelier {
  display: block;
  margin: 1.5rem auto;
}

.portfolio-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.react-logo {
  height: 7.5rem;
  width: auto;
  max-width: 100%;
}

html.dark-mode .portfolio-logo {
  color: #fff;
}

.logo_atelier {
  max-width: 100%;
  height: auto;
}

/* --- MENTIONS LÉGALES SPECIFIC --- */
.nav-close-btn {
  color: white;
  font-size: 1.5rem;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
}

.nav-close-btn:hover {
  color: var(--accent-color);
  transform: rotate(90deg);
}

.legal-content h2:not(:first-child) {
  margin-top: 2.5rem;
}

.legal-content strong {
  color: var(--primary-color);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-github {
  background-color: #24292e;
  color: white;
}

.btn-github:hover {
  background-color: #444c56;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: zoom-in;
}

.gallery-item img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

html.dark-mode .gallery-item img {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- STYLES PALETTE DE COULEURS --- */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.color-swatch {
  flex: 1;
  min-width: 7.5rem;
  height: 6.25rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.color-swatch:hover {
  transform: translateY(-5px);
}

.color-swatch .hex {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}

.color-swatch .name {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.9;
}

/* -- PALETTE MODE SOMBRE -- */
.swatch-dark-bg {
  background-color: #0e1225;
  color: white;
}

.swatch-dark-card {
  background-color: #2c2c3a;
  color: white;
}

.swatch-text {
  background-color: #eaeaea;
  color: #0e1225;
  border: 1px solid #ccc;
}

/* -- PALETTE MODE CLAIR -- */
.swatch-purple {
  background-color: #6c5ce7;
  color: white;
}

.swatch-light-purple {
  background-color: #6d76ce;
  color: white;
}

.swatch-yellow {
  background-color: #f1c40f;
  color: #2f3640;
}

.swatch-dark-yellow {
  background-color: #f39c12;
  color: white;
}

/* --- LIGHTBOX (Zoom Image) --- */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 5px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
  z-index: 2001;
}

.close-lightbox:hover {
  color: var(--accent-color);
}

/* --- CLASSES AJOUTÉES PAR LE JS --- */
.no-result-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--text-color);
  font-weight: 500;
}
.no-result-msg.hide {
  display: none;
}

.contact-form input.input-valid {
  border-color: #00b894;
}
.contact-form input.input-invalid {
  border-color: #d63031;
}

.form-status {
  margin-top: 1rem;
  font-weight: bold;
  text-align: center;
}
.form-status.success {
  color: var(--primary-color);
}
.form-status.error {
  color: #d63031;
}
.form-status.loading {
  color: #636e72;
  font-style: italic;
}

/* --- L'ATELIER DE LA FÈVE SPECIFIQUE --- */
.swatch-creme {
  background-color: #f3ede4;
  color: #211e1b;
  border: 1px solid #dcdcdc;
}
.swatch-cafe {
  background-color: #211e1b;
  color: #f3ede4;
}
.swatch-terracotta {
  background-color: #d99e82;
  color: white;
}
.swatch-sauge {
  background-color: #7d8d77;
  color: white;
}

.font-playfair {
  font-family: "Playfair Display", serif;
  font-size: 1.2rem;
  font-weight: bold;
}
.font-manrope {
  font-family: "Manrope", sans-serif;
  font-size: 1.1rem;
}
.da-spacing {
  margin-top: 2.5rem;
}

/* --- STUDIO ONYX SPECIFIC --- */
.swatch-onyx-dark {
  background-color: #121212;
  color: #e0e0e0;
  border: 1px solid #333;
}
.swatch-onyx-card {
  background-color: #242424;
  color: #e0e0e0;
  border: 1px solid #444;
}
.swatch-onyx-gold {
  background-color: #c5a059;
  color: black;
}
.swatch-onyx-light {
  background-color: #f8f9fa;
  color: #000000;
  border: 1px solid #ddd;
}
.swatch-onyx-black {
  background-color: #000000;
  color: #ffffff;
}

/* --- PROJET MAQUETTE JS SPECIFIC --- */
.swatch-bootstrap {
  background-color: #7952b3;
  color: white;
}
.swatch-canvas {
  background-color: #f8f9fa;
  color: #212529;
  border: 1px solid #dee2e6;
}
.swatch-ui-accent {
  background-color: #6c5ce7;
  color: white;
}

/* --- PROJET POKÉDEX SPECIFIC --- */
.pokedex-list-margin {
  margin-top: 1rem;
}

.pokedex-placeholder {
  background: #e1e1e1;
  height: 18.75rem;
  border-radius: 8px;
}

html.dark-mode .pokedex-placeholder {
  background: #3d3d4f;
}

/* --- PROJET PYGAME SPECIFIC --- */
.pygame-screen {
  background-color: #bbada0;
  width: 18.75rem;
  height: 18.75rem;
  border-radius: 1rem;
  padding: 0.625rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  position: relative;
}

.pygame-grid-2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
  width: 100%;
  height: 100%;
}

.pygame-cell {
  background-color: #cdc1b4;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.5rem;
  color: #776e65;
}

.cell-2 {
  background-color: #eee4da;
}
.cell-4 {
  background-color: #ede0c8;
}
.cell-8 {
  background-color: #f2b179;
  color: white;
}
.cell-2048 {
  background-color: #edc22e;
  color: white;
  box-shadow: 0 0 10px #edc22e;
}

.coinflip-bg {
  background-color: white;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1rem;
}

.coinflip-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: black;
}

.coinflip-container {
  display: flex;
  gap: 1rem;
}

.coinflip-btn {
  padding: 1rem 1.5rem;
  color: white;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-pile {
  background-color: #00c800;
}
.btn-face {
  background-color: #c80000;
}

.coinflip-result {
  font-size: 1.2rem;
  color: #00c800;
  font-weight: bold;
}

.btn-full {
  width: 100%;
  text-align: center;
  margin-top: 1rem;
}

.tech-list-center {
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.challenge-block {
  margin-bottom: 2rem;
}

/* --- PROJET SHIFUMI SPECIFIC --- */
.shifumi-terminal {
  background: #2d3436;
  color: #00cec9;
  font-family: Consolas, "Courier New", monospace;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem;
  border-radius: 8px;
}

.shifumi-terminal p {
  margin: 0.2rem 0;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
  .hero h1 {
    font-size: 2rem;
  }
  .about {
    flex-direction: column;
    text-align: center;
  }
  .desc {
    width: 100%;
  }
  .picture {
    min-height: 20rem;
    width: 80%;
    margin: 0 auto;
  }
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
    justify-content: space-between;
  }

  .navbar .logo {
    position: relative;
    z-index: 1001;
  }

  .burger-menu {
    display: block;
    order: 2;
    cursor: pointer;
    position: relative;
    z-index: 1001;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--header-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.4s ease;
    padding-top: 0;
    order: 3;
    overflow-y: hidden;
  }

  .nav-links.mobile-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links a {
    font-size: 1.5rem;
  }

  .toggle {
    display: none;
  }

  .nav-links.mobile-menu ~ .toggle {
    display: inline-block;
    position: fixed;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%) scale(1.2);
    z-index: 1002;
    animation: fadeIn 0.6s ease;
  }

  h1 {
    font-size: 1.8rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  .hero,
  main section {
    padding: 2rem 1rem;
  }
  .picture {
    width: 100%;
    min-height: 15rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
  .project-card:nth-child(1),
  .project-card:nth-child(6) {
    grid-column: span 1;
    grid-row: span 1;
  }

  .detail-section {
    padding: 1rem;
    flex-direction: column;
  }
  .content-card {
    padding: 1.5rem;
  }

  .containerwait {
    padding: 2rem;
    width: 95%;
  }
  .containerwait h1 {
    font-size: 2rem;
  }
  .containerwait p {
    font-size: 1rem;
  }

  footer {
    padding-bottom: 2rem;
  }

  .pygame-screen {
    width: 15.625rem;
    height: 15.625rem;
  }
}
