/* ===================== VARIABLES ======================= */
:root {
  --bg: #050608;
  --bg-alt: #0b0d12;
  --text: #f7f7f7;
  --muted: #a0a0a0;
  --accent: #00ff7b;
  --accent-soft: rgba(0, 255, 123, 0.12);
  --border: #20232c;

  --radius-lg: 18px;
  --radius-md: 12px;

  --shadow-soft: 0 0 40px rgba(0, 255, 123, 0.18);

  --card: rgba(255,255,255,0.03);
}

/* ===================== LIGHT THEME ======================= */
:root.light-theme {
  --bg: #f7f9fb;
  --bg-alt: #ffffff;
  --text: #111213;
  --muted: #5c5f66;
  --accent: #00cc6a;
  --accent-soft: rgba(0, 204, 106, 0.18);
  --border: rgba(0,0,0,0.12);
  --shadow-soft: 0 0 40px rgba(0,204,106,0.18);
  --card: rgba(0,0,0,0.04);
}

/* ===================== BASE =========================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;      /* FIX scroll horizontal global */
  width: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(circle at top, rgba(0,255,123,0.12), var(--bg) 40%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.light-theme {
  background: linear-gradient(to bottom, #ffffff, #f4f5f7);
  color: var(--text);
}

a {
  color: var(--text);
  text-decoration: none;
  transition: 0.25s ease;
}

a:hover {
  color: var(--accent);
}

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

/* ===================== SECTIONS ======================= */
.section {
  padding: 6rem 0;
  position: relative;
  background: var(--bg-alt);
  overflow-x: hidden;      /* sécurité anti-débordement */
}

.section-alt {
  background: var(--bg);
}

body.light-theme .section-alt {
  background: #f5f7f9;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--muted);
  max-width: 520px;
  margin: 0.25rem auto 0;
}

.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    rgba(0,255,123,0.5) 0%,
    rgba(0,255,123,0.2) 15%,
    rgba(0,255,123,0.1) 30%,
    rgba(0,255,123,0) 50%,
    rgba(0,255,123,0.1) 70%,
    rgba(0,255,123,0.2) 85%,
    rgba(0,255,123,0.5) 100%
  );
  opacity: 0;
  animation: separatorFade 0.8s ease forwards;
}

.light-theme .section::before {
  background: linear-gradient(
    90deg,
    rgba(0,226,109,0.35) 0%,
    rgba(0,226,109,0.08) 30%,
    rgba(0,226,109,0) 50%,
    rgba(0,226,109,0.08) 70%,
    rgba(0,226,109,0.35) 100%
  );
}

@keyframes separatorFade {
  0% { opacity: 0; transform: scaleX(0.6); }
  100% { opacity: 1; transform: scaleX(1); }
}

/* ===================== HEADER ========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(5, 6, 8, 0.9);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 0.4rem 0;
}

.light-theme .site-header {
  background: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
}

.brand-logo {
  width: 32px;
}

/* ===================== THEME TOGGLE ===================== */
.theme-toggle {
  width: 48px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  position: relative;
  transition: 0.3s ease;
  display: flex;
  align-items: center;
  padding: 2px;
}

.theme-toggle .toggle-circle {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  transition: 0.3s ease;
  transform: translateX(0);
}

.light-theme .theme-toggle {
  background: rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.2);
}

.light-theme .theme-toggle .toggle-circle {
  transform: translateX(24px);
  background: var(--accent);
}

/* ===================== NAVIGATION ====================== */
.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 0.25s ease, color 0.25s ease;
}

.nav-link:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.light-theme .nav-link {
  color: #444;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 2001;
}

.burger span {
  width: 28px;
  height: 3px;
  background: var(--text);
  border-radius: 5px;
  transition: 0.3s ease;
}

.burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100vw;           /* FIX scroll horizontal */
  width: 70%;
  height: 100vh;
  background: rgba(5, 6, 8, 0.97);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  padding: 6rem 0 0 2rem;
  gap: 2rem;
  transition: 0.35s ease;
  z-index: 2000;
}

.light-theme .mobile-nav {
  background: rgba(255,255,255,0.96);
}

.mobile-nav a {
  color: var(--text);
  font-size: 1.3rem;
}

.mobile-nav.open { right: 0; }

/* ===================== HERO ============================ */
.hero {
  background: linear-gradient(160deg, #0b0d12 0%, #050608 100%);
  text-align: center;
  padding: 4.5rem 0 6rem;
}

.hero-inner {
  max-width: 720px;
  margin-inline: auto;
}

.hero-logo-glow {
  width: 200px;
  height: 200px;
  margin: -10px auto 1rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0,255,123,0.2), transparent 70%);
  display: grid;
  place-items: center;
  animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 24px rgba(0,255,123,0.45);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(0,255,123,0.8);
  }
}

.hero-logo {
  width: 150px;
  margin-bottom: -1.25rem;
  filter: drop-shadow(0 0 14px rgba(0,255,123,0.7));
}

.hero-title {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.2;
}

.hero-subtitle {
  color: var(--muted);
  margin-top: 1rem;
  font-size: 1.125rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.5rem;
}

.hero-actions .btn {
  font-size: 1rem;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  border: none;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.hero-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(0,255,123,0.4);
}

.light-theme .hero {
  background: radial-gradient(circle at top center, #d6ffe8, #ffffff 80%);
}

/* ===================== GRID ============================ */
.services-grid,
.portfolio-grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: repeat(3, 1fr);
  overflow-x: hidden;      /* sécurité pour les hovers / box-shadow */
}

/* ===================== CARDS ============================ */
.card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.04);
  transition: 0.25s ease;
}

.light-theme .card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 55px rgba(0,0,0,0.7), var(--shadow-soft);
}

.project-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow: hidden;
  transition: 0.35s ease;
}

.light-theme .project-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
}

.project-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 28px 60px rgba(0,0,0,0.55), 0 0 20px rgba(0,255,123,0.25);
}

.project-thumb {
  height: 200px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  cursor: pointer;
}

/* Thumbnail classes – chemins corrigés */
.project-thumb.project1 {
  background-image: url('./img/game1_portefolio.png');
}

.project-thumb.project2 {
  background-image: url('./img/projet1_la_montagne.png');
}

.project-thumb.project3 {
  background-image: url('./img/game4_tictactoe.png');
}

.project-thumb.project4 {
  background-image: url('./img/projet2_le_resto.png');
}

.project-thumb.project5 {
  background-image: url('./img/game3_snake.png');
}

.project-thumb.project6 {
  background-image: url('./img/projet3_café.png');
}

.project-body {
  padding: 1.3rem 1.5rem 1.8rem;
}

.project-body h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.project-body p {
  color: var(--muted);
  margin: 0 0 0.8rem;
}

.project-card .tag {
  position: absolute;
  bottom: 16px;
  left: 20px;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
}

.light-theme .project-card .tag {
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.15);
  color: #222;
}

/* ===================== ABOUT =========================== */
.about-inner {
  max-width: 680px;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* ===================== CONTACT ========================= */
.contact-inner {
  max-width: 520px;
  margin-inline: auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}

input,
textarea {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  font-size: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.light-theme input,
.light-theme textarea {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.1);
  color: #111213;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0,255,123,0.35);
  background: rgba(0,0,0,0.35);
  transform: translateY(-2px);
}

.light-theme input:focus,
.light-theme textarea:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(0,226,109,0.25);
}

.contact-form button[type="submit"] {
  background: var(--accent);
  width: 100%;
  color: #000;
  font-size: 1.05rem;
  padding: 0.95rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0,255,123,0.55);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.contact-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0,255,123,0.7);
}

.form-note {
  text-align: center;
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.form-note a {
  color: var(--accent);
  font-weight: 600;
}

/* ===================== FAQ ========================== */

#faq .about-inner {
  max-width: 720px;
}

#faq h2 {
  margin-bottom: 2rem;
}

#faq h3 {
  font-size: 1.25rem;
  margin: 1.8rem 0 0.4rem;   /* espace réduit entre Q + R */
  font-weight: 600;
  color: var(--text);
}

#faq p {
  margin: 0 0 0.6rem;        /* espace minimal sous réponse */
  color: var(--muted);
  line-height: 1.55;
  font-size: 1rem;
}

/* Appearance modern */
#faq .about-inner > h3 {
  border-left: 3px solid var(--accent);
  padding-left: 0.8rem;
}

/* Light mode support */
.light-theme #faq h3 {
  color: #111;
  border-left-color: var(--accent);
}

.light-theme #faq p {
  color: #555;
}

/* ===================== FOOTER ========================== */
.site-footer {
  background: linear-gradient(to bottom, #030406, #050608);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.7rem 0;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.25);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 22px;
}

/* Icônes */
.icon-link svg {
  fill: var(--accent);
  transition: transform 0.25s ease, filter 0.25s ease;
}

.icon-link:hover svg {
  transform: scale(1.2);
  filter: drop-shadow(0 0 6px var(--accent));
}

/* Retour en haut */
.footer-inner a:last-child {
  text-align: right;
}

/* ===================== ZOOM OVERLAY ==================== */
.zoom-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(12px);

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 0;
  height: 100vh;

  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.light-theme .zoom-overlay {
  background: rgba(255,255,255,0.6);
}

.zoom-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.zoom-content {
  width: 100%;
  max-width: 600px;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* IMAGE ZOOMÉE */
.zoom-content img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(0,255,123,0.25);
  transform: scale(0.92);
  transition: transform 0.4s ease;
}

.light-theme .zoom-content img {
  box-shadow: 0 0 30px rgba(0,0,0,0.08);
}

.zoom-overlay.active img {
  transform: scale(1);
}

/* BOUTON "VOIR LE PROJET" */
#zoomLink {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  transition: 0.25s ease;
}

#zoomLink:hover {
  border-color: var(--accent);
  color: #000;
  background: var(--accent);
}

.light-theme #zoomLink {
  border-color: rgba(0,0,0,0.2);
}

.light-theme #zoomLink:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===================== ANIMATIONS ====================== */
.will-animate,
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: 0.5s ease;
}

.in-view,
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===================== MEDIA QUERIES =================== */

@media (max-width: 1200px) {
  .services-grid,
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .services-grid,
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
  }

  .burger {
    display: flex;
  }

  .hero-actions {
    flex-direction: column;
  }

  .footer-inner {
    display: flex;       
    flex-direction: column;
    text-align: center;
    gap: 0.4rem;
  }
}

@media (max-width: 768px) {
  .zoom-content {
    width: 100%;
    max-width: 500px;
  }
}

/* === FIX MOBILE VIEWPORT POUR OVERLAY  === */
/* Small viewport height (iOS Safari) */
@supports (height: 100svh) {
  .zoom-overlay {
    height: 100svh;
  }
}
/* Dynamic viewport height (Firefox mobile) */
@supports (height: 100dvh) {
  .zoom-overlay {
    height: 100dvh;
  }
}
/* Large viewport height (Chrome mobile) */
@supports (height: 100lvh) {
  .zoom-overlay {
    height: 100lvh;
  }
}
/* Fallback général mobile */
@media (max-width: 768px) {
  .zoom-overlay {
    height: 100vh;
  }
}

/* Limiter la hauteur de l’image sur mobile / viewport moderne */
.zoom-content img {
  max-height: 85svh;
  max-height: 85dvh;
  max-height: 85lvh;
  object-fit: contain;
}
