/* ---------------- RESET ---------------- */
:root.dark-mode {
  --main-color: #e7554e;
  --main-color-rgb: 231, 85, 78; /* pour rgba */
  --bg-primary: #0a0a0a;
  --bg-primary-transparent: rgba(10, 10, 10, 0.8);
  --bg-secondary: #0a0a0af3;
  --bg-tertiary: #222;
  --text-primary: #edece4;
  --text-secondary: #181617;
  --shadow-color: #edece4;
}

/* ---------------- LIGHT MODE ---------------- */
:root.light-mode {
  --main-color: #e7554e;
  --main-color-rgb: 231, 85, 78; /* pour rgba */
  --bg-primary: #f5f5f5;
  --bg-primary-transparent: rgba(245, 245, 245, 0.8);
  --bg-secondary: #f5f5f5f3;
  --bg-tertiary: #d4d4d4;
  --text-primary: #181617;
  --text-secondary: #f5f5f5;
  --shadow-color: #2a2628;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin; /* thin, auto ou none */
  scrollbar-color: var(--main-color, #e7554e) var(--bg-primary); /* thumb puis track */
}

body {
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  width: 100%;
  overflow-x: hidden;
}

/* Scrollbar pour Chrome, Edge et Safari */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background-color: var(--main-color, #e7554e);
  border: 3px solid var(--bg-primary);
  border-radius: 0;
}

/* ---------------- WRAPPER ---------------- */
.wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

/* ---------------- HEADER ---------------- */
.header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-primary-transparent);
  border-bottom: 3px solid var(--main-color, #e7554e);
  backdrop-filter: blur(12px) saturate(180%);
  height: 5rem;
}

.header__container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 5rem;
}

/* Logo */
.header__logo {
  padding: 0.5rem;
}

.header__logo .logo-f {
  fill: var(--main-color, #e7554e);
}

.header__logo .logo-n {
  fill: var(--text-primary);
}

  .logo-f, .logo-n {
    font-family: 'Nanum Gothic', sans-serif;
  }

/* Navigation */
.header__nav {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.header__link {
  font-family: Inter, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  position: relative;
  overflow: hidden;
  transition: color 0.3s ease;
}

.header__link::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: -100%;
  background-color: var(--main-color, #e7554e);
  transition: left 0.3s ease;
}

.header__link:hover {
  color: var(--main-color, #e7554e);
}

.header__link:hover::before {
  left: 0;
}

/* ---------------- THEME SWITCH ---------------- */

/* CSS commun pour tous les switches */
.switch {
  position: relative;
  width: 4rem;
  height: 2rem;
  border: 2px solid var(--text-primary);
  cursor: pointer;
}

.switch-cursor {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.6rem;
  height: calc(100% - 4px);
  background-color: #181617;
  color: #edece4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: left 0.3s ease;
}

/* Couleurs spécifiques */
#theme-switch {
  background: linear-gradient(to right, #f5b800 50%, #150e62 50%);
}

#animation-switch {
  background: linear-gradient(to right, #10b981 50%, #ef4444 50%);
}

/* États */
.dark-mode #theme-switch .switch-cursor,
#animation-switch.paused .switch-cursor {
  left: calc(100% - 1.6rem - 2px);
}

/* ---------------- HERO ---------------- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  height: calc(100vh - 5rem);
  padding: 4rem 0.5rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background-image: 
    radial-gradient(circle, transparent 20%, rgba(var(--main-color-rgb), 0.08) 20%, rgba(var(--main-color-rgb), 0.08) 21%, transparent 21%),
    radial-gradient(circle, transparent 40%, rgba(var(--main-color-rgb), 0.08) 40%, rgba(var(--main-color-rgb), 0.08) 41%, transparent 41%),
    radial-gradient(circle, transparent 60%, rgba(var(--main-color-rgb), 0.08) 60%, rgba(var(--main-color-rgb), 0.08) 61%, transparent 61%);
  background-size: 200px 200px;
  background-position: center;
  z-index: 0;
  pointer-events: none;
  
  /* Masque pour fondu progressif */
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.8) 80%,
    rgba(0, 0, 0, 0.6) 85%,
    rgba(0, 0, 0, 0.4) 90%,
    rgba(0, 0, 0, 0.2) 95%,
    rgba(0, 0, 0, 0.1) 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.8) 80%,
    rgba(0, 0, 0, 0.6) 85%,
    rgba(0, 0, 0, 0.4) 90%,
    rgba(0, 0, 0, 0.2) 95%,
    rgba(0, 0, 0, 0.1) 100%
  );
}


.hero__title {
  font-family: Oswald, sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 2rem;
  position: relative;
}

.hero__title-part {
  display: block;
  margin-bottom: -0.05em;
  text-shadow:
    3px 3px 0 var(--main-color, #e7554e),
    6px 6px 0 rgb(var(--main-color-rgb, 231, 85, 78), 0.5);
}

.hero__title-part:hover {
  animation: glitch 0.3s ease;
}

@keyframes glitch {
  0%,
  100% {
    transform: translate(0);
  }

  25% {
    transform: translate(-2px, 2px);
  }

  50% {
    transform: translate(2px, -2px);
  }

  75% {
    transform: translate(-2px, -2px);
  }
}

.hero__subtitle {
  padding-left: 0.2rem;
}

.hero__cta {
  display: inline-block;
  padding: 1rem 2rem;
  background-color: var(--main-color, #e7554e);
  color: var(--text-secondary);
  border: 3px solid var(--text-secondary);
  text-decoration: none;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 1rem;
  box-shadow: 6px 6px 0 var(--shadow-color);
  transition: all 0.2s ease;
  cursor: pointer;
  margin-top: 2rem;
}

.hero__cta:hover {
  background-color: var(--main-color, #e7554e);
  transform: translate(-4px, -4px);
  box-shadow: 12px 12px 0 var(--shadow-color);
}

.hero__cta:active {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--shadow-color);
}

/* ---------------- PROJECTS ---------------- */
.projects {
  padding: 6rem 0.5rem;
}

.projects__title,
.about__title {
  font-family: Oswald, sans-serif;
  font-size: 2.5rem;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 4rem;
  text-align: center;
  text-shadow: 2px 2px 0 var(--main-color, #e7554e);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

/* Cards */
.projects__card {
  background-color: var(--bg-secondary);
  border: 3px solid var(--main-color, #e7554e);
  box-shadow: 6px 6px 0 var(--shadow-color);
  border-radius: 0;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.projects__card-image {
  width: 100%;
  margin: 0;
}

.projects__card-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: top;
  display: block;
  border-bottom: 3px solid var(--main-color, #e7554e);
  margin: 0;
}

.projects__card-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.projects__card-title,
.about__profile-title {
  font-family: Oswald, sans-serif;
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.projects__card-description {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.projects__card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 12px 12px 0 var(--shadow-color);
}

.projects__card:active {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--shadow-color);
}

/* ---------------- PROJECT TAGS ---------------- */
.project-tags {
  font-family: Inter, sans-serif;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-top: 1rem;
}

.project-tags .tag {
  display: inline-block;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 2px solid var(--main-color, #e7554e);
  padding: 0.2rem 0.6rem;
  margin: 0 0.5rem 0.5rem 0;
  border-radius: 0;
  font-weight: 600;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--shadow-color);
  transition: all 0.2s ease;
  cursor: default;
}

/* ---------------- MODAL ---------------- */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(10 10 10 / 90%);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal--open {
  opacity: 1;
}

.modal-content {
  background-color: var(--bg-primary);
  padding: 2rem;
  max-width: 800px;
  width: 100%;
  border: 3px solid var(--main-color, #e7554e);
  box-shadow: 6px 6px 0 var(--shadow-color);
  overflow-y: auto;
  max-height: 90vh;
  position: relative;
  display: flex;
  flex-direction: column;
  transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.22);
  opacity: 0;
  transition:
    transform 0.42s cubic-bezier(0.2, 0.9, 0.3, 1),
    opacity 0.32s ease;
}

.modal--open .modal-content {
  transform: translate(0, 0) scale(1);
  opacity: 1;
}

.modal-close {
  position: sticky;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-primary);
  z-index: 10;
  align-self: flex-end;
  background: none;
  border: none;
}

.modal-close:hover {
  transform: scale(1.1);
  color: #fff;
}

.project-content h1,
.project-content h2,
.project-content h3 {
  font-family: Oswald, sans-serif;
  color: var(--main-color, #e7554e);
  margin-bottom: 1rem;
}

.project-content p {
  font-family: Inter, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-content a {
  color: var(--main-color, #e7554e);
  text-decoration: underline;
  transition: color 0.3s ease;
}

.project-content a:hover {
  color: #ff6b5c;
}

.project-content ul,
.project-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.project-content li {
  margin-bottom: 0.5rem;
}

.project-content pre {
  background-color: var(--bg-secondary);
  padding: 1rem;
  overflow-x: auto;
  border-left: 4px solid var(--main-color, #e7554e);
  margin-bottom: 1rem;
}

.project-content code {
  font-family: 'Courier New', monospace;
  background-color: var(--bg-tertiary);
  padding: 2px 4px;
  border-radius: 2px;
}

.project-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.project-content th,
.project-content td {
  border: 2px solid var(--main-color, #e7554e);
  padding: 0.5rem 1rem;
  text-align: left;
}

.project-content input[type='checkbox'] {
  accent-color: var(--main-color, #e7554e);
  margin-right: 0.5rem;
}

.project-content img {
  max-width: 100%;
  display: block;
  margin: 1rem 0;
  border: 1px solid var(--text-primary);
}

/* ---------------- ABOUT ---------------- */
.about {
  padding: 6rem 0.5rem;
  position: relative;
  z-index: 10;
}

.about__container {
  background-color: var(--bg-secondary);
  border: 3px solid var(--main-color, #e7554e);
  box-shadow: 6px 6px 0 var(--shadow-color);
  padding: 6rem 2rem;
}

.about__content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  align-items: start;
}

.about__profile {
  padding: 2rem;
}

.about__avatar {
  width: 120px;
  height: 120px;
  background-color: var(--bg-primary);
  border: 3px solid var(--main-color, #e7554e);
  box-shadow: 4px 4px 0 var(--shadow-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-family: Oswald, sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.about__profile-title {
  text-align: center;
  text-transform: uppercase;
}

.about__role {
  text-align: center;
  color: var(--main-color, #e7554e);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--main-color, #e7554e);
}

/* Badges */
.about__badges {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about__badge {
  background-color: var(--main-color, #e7554e);
  border: 2px solid var(--text-secondary);
  padding: 0.8rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
  box-shadow: 4px 4px 0 var(--shadow-color);
  transition: all 0.2s ease;
  text-decoration: none;
}

.about__badge:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--shadow-color);
}

.about__badge:active {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow-color);
}

.about__badge-icon {
  margin-right: 0.5rem;
}

/* Colonne droite - Texte */
.about__text p {
  font-family: Inter, sans-serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  text-align: left;
}

.about__text p strong {
  color: var(--main-color, #e7554e);
  font-weight: 600;
}

/* Highlights - Points clés */
.about__highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.about__highlight {
  background-color: var(--bg-primary);
  border: 3px solid var(--main-color, #e7554e);
  box-shadow: 4px 4px 0 var(--shadow-color);
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.about__highlight-title {
  font-family: Oswald, sans-serif;
  font-size: 1.1rem;
  color: var(--main-color, #e7554e);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.about__highlight-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ---------------- BACK TO TOP ---------------- */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--main-color, #e7554e);
  color: var(--bg-primary);
  border: 2px solid var(--text-secondary);
  box-shadow: 4px 4px 0 var(--shadow-color);
  font-size: 1.5rem;
  font-weight: bold;
  width: 50px;
  height: 50px;
  border-radius: 0;
  cursor: pointer;
  display: none;
  transition: all 0.3s ease;
  z-index: 3000;
}

#back-to-top:hover {
  background-color: var(--main-color, #e7554e);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--shadow-color);
}

#back-to-top:active {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow-color);
}

/* ---------------- FOOTER ---------------- */
.footer {
  padding: 3rem 0.5rem;
  background-color: var(--bg-primary);
  border-top: 3px solid var(--main-color, #e7554e);
  text-align: center;
  font-family: Inter, sans-serif;
  color: var(--text-primary);
}

.footer a {
  color: var(--main-color, #e7554e);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #ff6b5c;
}

.footer p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Canvas full screen derrière le contenu */
#bubbles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* ---------------- RESPONSIVE ---------------- */

/* Desktop Large - 1024px */
@media (width <= 1024px) {
  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .about__content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about__profile {
    max-width: 400px;
    margin: 0 auto;
  }

  .about__highlights {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet - 768px */
@media (width <= 768px) {
  /* Header */
  .header {
    height: auto;
    min-height: 80px;
  }

  .header__container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0.5rem;
  }

  .header__logo {
    font-size: 1.5rem;
  }

  .header__nav {
    gap: 1rem;
  }

  .header__link {
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
  }

  /* Hero */
  .hero {
    height: auto;
    min-height: calc(100vh - 80px);
    padding: 3rem 0.5rem;
    text-align: center;
    align-items: center;
  }

  .hero__title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    text-align: left;
  }

  .hero__cta {
    font-size: 0.9rem;
    padding: 0.8rem 1.6rem;
  }

  /* Projects */
  .projects {
    padding: 4rem 0.5rem;
  }

  .projects__title,
  .about__title {
    font-size: 2rem;
    margin-bottom: 3rem;
  }

  .projects__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .projects__card-title {
    font-size: 1.4rem;
  }

  .projects__card-content {
    padding: 1.5rem;
  }

  /* About */
  .about {
    padding: 4rem 0.5rem;
  }

  .about__container {
    padding: 3rem 1.5rem;
  }

  .about__highlights {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .about__highlight {
    padding: 1.25rem;
  }

  /* Modal */
  .modal {
    padding: 1rem;
  }

  .modal-content {
    padding: 1.5rem;
    max-height: 85vh;
  }

  /* Back to top */
  #back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
}

/* Mobile - 480px */
@media (width <= 480px) {
  /* Header */
  .header__logo {
    font-size: 1.3rem;
  }

  .header__nav {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .header__link {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }

  /* Switches */
  .switch {
    width: 3.5rem;
    height: 1.8rem;
  }

  .switch-cursor {
    width: 1.4rem;
    font-size: 0.8rem;
  }

  .dark-mode #theme-switch .switch-cursor,
  #animation-switch.paused .switch-cursor {
    left: calc(100% - 1.4rem - 2px);
  }

  /* Hero */
  .hero {
    padding: 2rem 0.5rem;
  }

  .hero__title {
    font-size: clamp(2rem, 10vw, 3rem);
    margin-bottom: 1.5rem;
  }

  .hero__cta {
    font-size: 0.85rem;
    padding: 0.7rem 1.4rem;
    box-shadow: 4px 4px 0 var(--shadow-color);
  }

  .hero__cta:hover {
    box-shadow: 8px 8px 0 var(--shadow-color);
  }

  /* Projects */
  .projects,
  .about {
    padding: 3rem 0.5rem;
  }

  .projects__title,
  .about__title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  .projects__card {
    box-shadow: 4px 4px 0 var(--shadow-color);
  }

  .projects__card:hover {
    box-shadow: 8px 8px 0 var(--shadow-color);
  }

  .projects__card-content {
    padding: 1.25rem;
  }

  .projects__card-title {
    font-size: 1.3rem;
  }

  .projects__card-description {
    font-size: 0.95rem;
  }

  .project-tags {
    font-size: 0.85rem;
  }

  .project-tags .tag {
    padding: 0.15rem 0.5rem;
    box-shadow: 2px 2px 0 var(--shadow-color);
  }

  /* About */
  .about__container {
    padding: 2rem 1rem;
    box-shadow: 4px 4px 0 var(--shadow-color);
  }

  .about__profile {
    padding: 1.5rem;
  }

  .about__avatar {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
    box-shadow: 3px 3px 0 var(--shadow-color);
  }

  .about__profile-title {
    font-size: 1.4rem;
  }

  .about__text p {
    font-size: 1rem;
  }

  .about__highlight {
    padding: 1rem;
  }

  .about__badge {
    padding: 0.6rem;
    font-size: 0.85rem;
    box-shadow: 3px 3px 0 var(--shadow-color);
  }

  /* Modal */
  .modal {
    padding: 0.5rem;
  }

  .modal-content {
    padding: 1rem;
    border-width: 2px;
    box-shadow: 4px 4px 0 var(--shadow-color);
  }

  .modal-close {
    font-size: 1.5rem;
  }

  .project-content h1 {
    font-size: 1.8rem;
  }

  .project-content h2 {
    font-size: 1.5rem;
  }

  .project-content h3 {
    font-size: 1.2rem;
  }

  /* Footer */
  .footer {
    padding: 2rem 0.5rem;
  }

  .footer p {
    font-size: 0.9rem;
  }

  /* Back to top */
  #back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    box-shadow: 3px 3px 0 var(--shadow-color);
  }

  #back-to-top:hover {
    box-shadow: 6px 6px 0 var(--shadow-color);
  }
}
