/* ============ VARIABLES (change les couleurs ici) ============
   Thème sombre par défaut. Le thème clair s'applique seulement si le
   visiteur l'a choisi avec le bouton ☀️/🌙 (data-theme="light"). */
:root {
  --bg: #0d1224;
  --bg-alt: #121a33;
  --card: #18223f;
  --text: #e8ecf8;
  --muted: #9aa5c4;
  --accent: #ff7a59;      /* couleur principale des boutons */
  --accent-2: #7c5cff;    /* couleur secondaire */
  --accent-ink: #ff7a59;  /* textes de couleur accent (plus foncé en clair, pour la lisibilité) */
  --line: rgba(255, 255, 255, .06);        /* bordures discrètes */
  --line-strong: rgba(255, 255, 255, .14); /* bordures des champs et boutons */
  --track: rgba(255, 255, 255, .2);        /* barres vides, points, étoiles éteintes */
  --header-bg: rgba(13, 18, 36, .85);
  --title-grad: linear-gradient(90deg, #fff, #ffd2c4 60%, #ff7a59);
  --tag-bg: rgba(124, 92, 255, .15);
  --tag-text: #c7bbff;
  --ok: #7ee2a8;
  --err: #ff8a8a;
  --blob-opacity: .45;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);
  --font-title: "Space Grotesk", system-ui, sans-serif;
  --font-text: "Inter", system-ui, sans-serif;
  color-scheme: dark;
}
/* Choix explicite du visiteur */
:root[data-theme="light"] {
  --bg: #f7f5f2;
  --bg-alt: #efeae4;
  --card: #ffffff;
  --text: #1a1f36;
  --muted: #5a6380;
  --accent-ink: #c2410c;
  --line: rgba(26, 31, 54, .09);
  --line-strong: rgba(26, 31, 54, .16);
  --track: rgba(26, 31, 54, .12);
  --header-bg: rgba(247, 245, 242, .88);
  --title-grad: linear-gradient(90deg, #1a1f36, #7a3322 60%, #c2410c);
  --tag-bg: rgba(124, 92, 255, .12);
  --tag-text: #5236c9;
  --ok: #1a7f4b;
  --err: #c62828;
  --blob-opacity: .22;
  --shadow: 0 18px 40px rgba(26, 31, 54, .10);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { background: var(--bg); color: var(--text); transition: background-color .3s, color .3s; font-family: var(--font-text); line-height: 1.6; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.15; }
[hidden] { display: none !important; }

/* ============ ACCESSIBILITÉ ============ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 300; background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 10px; transition: top .2s; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ============ BOUTONS ============ */
.btn {
  display: inline-block; padding: 14px 28px; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; font-size: 1rem;
  transition: transform .25s, box-shadow .25s, background .25s;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(255, 122, 89, .4); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }
.btn-ghost { background: transparent; color: var(--accent-ink); }
.btn-ghost:hover { background: var(--accent); color: #fff; }
.btn-small { padding: 8px 20px; }

/* ============ BARRE DE PROGRESSION ============ */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ============ EN-TÊTE ============ */
.header { position: fixed; inset: 0 0 auto; z-index: 100; transition: background .3s, box-shadow .3s; }
.header.scrolled { background: var(--header-bg); backdrop-filter: blur(12px); box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { font-family: var(--font-title); font-weight: 700; font-size: 1.3rem; color: var(--accent-ink); }
.nav-links { display: flex; gap: 28px; list-style: none; align-items: center; margin-left: auto; margin-right: 18px; }
.nav-links a:not(.btn) { position: relative; color: var(--muted); transition: color .2s; }
.nav-links a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0; background: var(--accent); transition: width .3s; }
.nav-links a:not(.btn):hover, .nav-links a.active:not(.btn) { color: var(--text); }
.nav-links a:not(.btn):hover::after, .nav-links a.active:not(.btn)::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); color: var(--text);
  display: grid; place-items: center; cursor: pointer; transition: transform .3s, background .3s; }
.theme-toggle:hover { transform: rotate(20deg); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; }
.nav-toggle span { width: 26px; height: 2px; background: var(--text); transition: .3s; }

/* ============ ACCUEIL ============ */
.hero { min-height: 100vh; display: flex; align-items: center; position: relative; padding: 110px 0 60px; overflow: hidden; }
.hero-bg .blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--blob-opacity); animation: float 12s ease-in-out infinite; }
.blob-1 { width: 420px; height: 420px; background: var(--accent-2); top: -80px; right: -100px; }
.blob-2 { width: 360px; height: 360px; background: var(--accent); bottom: -120px; left: -120px; animation-delay: -6s; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; position: relative; }
.hero-hello { color: var(--muted); font-size: 1.1rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin: 6px 0;
  background: var(--title-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-role { font-family: var(--font-title); font-size: clamp(1.2rem, 2.6vw, 1.7rem); color: var(--accent-ink); min-height: 2.2em; }
.cursor { animation: blink 1s steps(1) infinite; margin-left: 2px; }
.hero-desc { color: var(--muted); max-width: 520px; margin: 12px 0 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-family: var(--font-title); font-size: 2.2rem; color: var(--text); }
.hero-stats strong::after { content: "+"; color: var(--accent-ink); }
.hero-stats span { color: var(--muted); font-size: .9rem; }

.hero-photo { position: relative; justify-self: center; }
.photo-frame { width: min(360px, 78vw); aspect-ratio: 1; position: relative;
  border-radius: 42% 58% 55% 45% / 45% 42% 58% 55%; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); padding: 6px;
  animation: morph 10s ease-in-out infinite; box-shadow: var(--shadow); }
.photo-frame img, .photo-fallback { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; border-radius: inherit; }
.photo-fallback { display: none; place-items: center; background: var(--card); font-family: var(--font-title); font-size: 5rem; color: var(--accent); }
.float-badge { position: absolute; background: var(--card); padding: 10px 16px; border-radius: 12px; font-size: .85rem;
  box-shadow: var(--shadow); border: 1px solid var(--line-strong); animation: float 6s ease-in-out infinite; white-space: nowrap; }
.badge-1 { top: 10%; left: -30px; }
.badge-2 { bottom: 12%; right: -20px; animation-delay: -3s; }
.scroll-down { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--muted); border-radius: 20px; }
.scroll-down span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; background: var(--accent); border-radius: 4px; animation: scrollDot 1.8s infinite; }

/* ============ SECTIONS ============ */
.section { padding: 110px 0; }
.section-alt { background: var(--bg-alt); }
.eyebrow { color: var(--accent-ink); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .85rem; }
.section-title { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 8px 0 44px; }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 22px; }
.service-card { background: var(--card); border-radius: var(--radius); padding: 30px 26px; border: 1px solid var(--line);
  transition: transform .35s, border-color .35s, box-shadow .35s; }
.service-card:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: var(--shadow); }
.service-icon { font-size: 2.2rem; display: inline-block; transition: transform .4s; }
.service-card:hover .service-icon { transform: scale(1.2) rotate(-8deg); }
.service-card h3 { margin: 14px 0 8px; }
.service-card p { color: var(--muted); font-size: .95rem; }
.service-meta { margin-top: 16px; display: flex; justify-content: space-between; font-size: .85rem; gap: 8px; flex-wrap: wrap; }
.service-meta strong { color: var(--accent-ink); }

/* Projets */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: -20px 0 34px; }
.filter-btn { background: var(--card); color: var(--muted); border: 1px solid var(--line-strong); padding: 8px 18px; border-radius: 999px; cursor: pointer; font: inherit; transition: .25s; }
.filter-btn.active, .filter-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 26px; }
.project-card { background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer; border: 1px solid var(--line);
  transition: transform .2s ease-out, box-shadow .35s, opacity .4s; transform-style: preserve-3d; }
.project-card:hover { box-shadow: var(--shadow); }
.project-card.hide { display: none; }
.project-thumb { aspect-ratio: 16/10; overflow: hidden; position: relative; background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.project-thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.project-card:hover .project-thumb img { transform: scale(1.08); }
.project-thumb .overlay { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(13,18,36,.7); color: #fff; opacity: 0; transition: opacity .35s; font-weight: 600; }
.project-card:hover .overlay, .project-card:focus-visible .overlay { opacity: 1; }
.thumb-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-title); font-size: 1.4rem; padding: 20px; text-align: center; }
.project-body { padding: 22px; }
.project-cat { font-size: .78rem; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.project-body h3 { margin: 6px 0; }
.project-body p { color: var(--muted); font-size: .95rem; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.tag { font-size: .75rem; background: var(--tag-bg); color: var(--tag-text); padding: 4px 10px; border-radius: 999px; }

/* Témoignages */
.carousel { position: relative; overflow: hidden; }
.carousel-track { display: flex; transition: transform .6s cubic-bezier(.65,0,.35,1); }
.testimonial { flex: 0 0 100%; padding: 8px; }
.testimonial-inner { background: var(--card); border-radius: var(--radius); padding: 40px; max-width: 760px; margin: auto; position: relative; border: 1px solid var(--line); }
.testimonial-inner::before { content: "“"; position: absolute; top: -10px; left: 24px; font-size: 7rem; color: var(--accent); opacity: .3; font-family: Georgia, serif; line-height: 1; }
.testimonial-stars { color: #ffc24b; letter-spacing: 3px; }
.testimonial-text { font-size: 1.15rem; margin: 14px 0 22px; }
.testimonial-author { display: flex; align-items: center; gap: 14px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.testimonial-author small { color: var(--muted); display: block; }
.carousel-controls { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 24px; }
.carousel-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); cursor: pointer; font-size: 1.1rem; transition: .25s; }
.carousel-btn:hover { background: var(--accent); }
.carousel-dots { display: flex; gap: 8px; }
.carousel-dots button { width: 10px; height: 10px; border-radius: 999px; border: 0; background: var(--track); cursor: pointer; transition: .3s; }
.carousel-dots button.active { width: 28px; background: var(--accent); }
.testimonial-cta { text-align: center; margin-top: 60px; padding: 40px 20px; border-radius: var(--radius); border: 1px dashed rgba(255,122,89,.5); }
.testimonial-cta p { color: var(--muted); margin: 6px 0 20px; }

/* À propos */
.about-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; align-items: center; }
.about-photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5; background: linear-gradient(135deg, var(--accent-2), var(--accent)); position: relative; box-shadow: var(--shadow); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo.no-photo img { display: none; }
.about-fallback { display: none; position: absolute; inset: 0; place-items: center; font-family: var(--font-title); font-size: 6rem; color: rgba(255,255,255,.9); }
.about-photo.no-photo .about-fallback { display: grid; }
.about-text p { color: var(--muted); }
.about-text h3 { margin: 28px 0 16px; }
.skills { display: grid; gap: 14px; margin-bottom: 30px; }
.skill-top { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.skill-bar { height: 8px; background: var(--track); border-radius: 999px; overflow: hidden; }
.skill-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; transition: width 1.4s cubic-bezier(.2,.8,.2,1); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; }
.contact-grid > div > p { color: var(--muted); }
.contact-list { list-style: none; margin: 26px 0; display: grid; gap: 12px; }
.contact-list a:hover { color: var(--accent-ink); }
.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.socials a { padding: 8px 16px; border-radius: 999px; background: var(--card); font-size: .9rem; transition: .25s; }
.socials a:hover { background: var(--accent); }
.form { display: grid; gap: 14px; background: var(--card); padding: 30px; border-radius: var(--radius); }
.form label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.form input, .form select, .form textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,122,89,.25); }
.form .hp { display: none; }
.form-status { font-size: .9rem; color: var(--ok); min-height: 1.2em; }
.form-status.error { color: var(--err); }

/* Étoiles */
.stars { position: relative; border: 0; display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.stars legend { color: var(--muted); font-size: .9rem; margin-bottom: 4px; width: 100%; }
.stars input { position: absolute; opacity: 0; }
.stars label { font-size: 1.8rem; color: var(--track); cursor: pointer; transition: color .2s, transform .2s; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #ffc24b; }
.stars label:hover { transform: scale(1.2); }
.stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Fenêtres */
.modal { margin: auto; border: 0; border-radius: var(--radius); background: var(--bg-alt); color: var(--text); width: min(640px, 100% - 32px); max-height: 90vh; overflow-y: auto; padding: 32px; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(5, 8, 20, .75); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .35s cubic-bezier(.2,.9,.3,1.2); }
.modal h3 { margin-bottom: 16px; }
.modal .form { padding: 0; background: none; }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: 0; color: var(--muted); font-size: 2rem; cursor: pointer; }
.detail-img { border-radius: 12px; margin: 16px 0; background: linear-gradient(135deg, var(--accent-2), var(--accent)); aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.detail-block { margin: 12px 0; }
.detail-block strong { color: var(--accent-ink); display: block; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.detail-links { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* Pied de page */
.footer { padding: 30px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* WhatsApp */
.whatsapp-float { position: fixed; right: 20px; bottom: 20px; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; z-index: 150; box-shadow: 0 10px 25px rgba(37,211,102,.4); animation: pulse 2.4s infinite; transition: transform .25s; }
.whatsapp-float:hover { transform: scale(1.1); }

/* ============ ANIMATIONS AU DÉFILEMENT ============ */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.visible { opacity: 1; transform: none; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
@keyframes morph { 0%,100% { border-radius: 42% 58% 55% 45% / 45% 42% 58% 55%; } 50% { border-radius: 58% 42% 45% 55% / 55% 58% 42% 45%; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes scrollDot { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(16px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.55); } 70% { box-shadow: 0 0 0 18px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }
@keyframes pop { from { opacity: 0; transform: scale(.9) translateY(20px); } to { opacity: 1; transform: none; } }

/* ============ MOBILE ============ */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links { position: fixed; inset: 72px 0 auto; margin: 0; flex-direction: column; background: var(--bg-alt); padding: 24px; gap: 20px;
    transform: translateY(-120%); visibility: hidden; transition: transform .4s, visibility .4s; box-shadow: var(--shadow); }
  .nav-links.open { transform: none; visibility: visible; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .hero-text { text-align: center; }
  .hero-desc { margin-inline: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  .badge-1 { left: -6px; } .badge-2 { right: -6px; }
  .section { padding: 80px 0; }
  .modal { padding: 26px 20px; }
  .testimonial-inner { padding: 30px 22px; }
  .about-photo { max-width: 380px; margin: auto; width: 100%; }
}

/* Respect du réglage « réduire les animations » du téléphone */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
