/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Accent (bold & créatif) */
  --accent: #7C5CFC;
  --accent-2: #FF5D9E;
  --accent-3: #23D5EE;
  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);

  --radius: 20px;
  --maxw: 1180px;
  --ease: cubic-bezier(.22,1,.36,1);

  /* Thème sombre (défaut) */
  --bg: #0B0B12;
  --bg-soft: #14141f;
  --surface: rgba(255,255,255,.04);
  --surface-strong: rgba(255,255,255,.07);
  --border: rgba(255,255,255,.10);
  --text: #F4F4FA;
  --muted: #A5A5B8;
  --shadow: 0 30px 80px -30px rgba(0,0,0,.7);
}

[data-theme="light"] {
  --bg: #F6F5FB;
  --bg-soft: #ffffff;
  --surface: rgba(20,20,40,.03);
  --surface-strong: rgba(20,20,40,.05);
  --border: rgba(20,20,50,.10);
  --text: #16151F;
  --muted: #5A5972;
  --shadow: 0 30px 80px -40px rgba(60,40,120,.35);
}

html { scroll-behavior: smooth; }

/* Lenis (smooth scroll) — styles requis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Transition douce des couleurs lors du changement de thème (classe ajoutée le temps du switch) */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color .55s var(--ease),
              border-color .55s var(--ease),
              color .55s var(--ease),
              fill .55s var(--ease),
              stroke .55s var(--ease),
              box-shadow .55s var(--ease);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

h1, h2, h3, .nav__logo { font-family: 'Space Grotesk', sans-serif; letter-spacing: -.02em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }

/* ============================================================
   FONDS ANIMÉS
============================================================ */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: .5;
}
.blob {
  position: fixed; z-index: -2; border-radius: 50%;
  filter: blur(90px); opacity: .5; pointer-events: none;
  transition: opacity .5s var(--ease);
}
.blob-1 { width: 500px; height: 500px; background: var(--accent); top: -140px; left: -120px; animation: float1 14s ease-in-out infinite; }
.blob-2 { width: 460px; height: 460px; background: var(--accent-2); top: 40%; right: -140px; animation: float2 16s ease-in-out infinite; }
[data-theme="light"] .blob { opacity: .28; }

@keyframes float1 { 0%,100%{ transform: translate(0,0) scale(1); } 50%{ transform: translate(60px,50px) scale(1.1); } }
@keyframes float2 { 0%,100%{ transform: translate(0,0) scale(1); } 50%{ transform: translate(-50px,-40px) scale(1.15); } }

/* ============================================================
   PROGRESS BAR
============================================================ */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--grad); z-index: 100;
  /* Croissance progressive en ease-in-out */
  transition: width .45s cubic-bezier(.65, 0, .35, 1);
}

/* ============================================================
   NAV
============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 48px);
  transition: padding .4s var(--ease), background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding: 12px clamp(20px, 5vw, 48px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.15rem; }
.nav__logo-mark { color: var(--accent); animation: spin 8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.nav__links { display: flex; gap: 6px; }
.nav__links a {
  position: relative; padding: 8px 14px; font-size: .93rem; font-weight: 500;
  color: var(--muted); border-radius: 10px; transition: color .25s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); }

.nav__actions { display: flex; align-items: center; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; min-width: 44px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: .85rem;
  cursor: pointer; transition: transform .2s var(--ease), background .25s, border-color .25s;
}
.pill:hover { transform: translateY(-2px); background: var(--surface-strong); border-color: var(--accent); }
.pill--icon { width: 38px; min-width: 38px; padding: 0; }
.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.nav__burger { display: none; flex-direction: column; gap: 5px; width: 38px; height: 38px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px; cursor: pointer; align-items: center; justify-content: center; }
.nav__burger span { width: 18px; height: 2px; background: var(--text); transition: .3s var(--ease); }

/* ============================================================
   LAYOUT SECTIONS
============================================================ */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(70px, 12vh, 140px) clamp(20px, 5vw, 48px); }
.section__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 48px; }
.section__num { font-family: 'Space Grotesk'; font-size: .9rem; font-weight: 700; color: var(--accent); }
.section__title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }

/* ============================================================
   HERO
============================================================ */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); position: relative;
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 9px; align-self: flex-start;
  padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: .82rem; color: var(--muted); margin-bottom: 26px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #33e08a; box-shadow: 0 0 0 0 rgba(51,224,138,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0%{ box-shadow:0 0 0 0 rgba(51,224,138,.6);} 70%{ box-shadow:0 0 0 10px rgba(51,224,138,0);} 100%{ box-shadow:0 0 0 0 rgba(51,224,138,0);} }

.hero__title { font-size: clamp(2.6rem, 8vw, 6rem); line-height: .98; font-weight: 700; margin-bottom: 26px; }
.hero__title .line { display: block; }
.line--grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% auto; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }

.hero__sub { max-width: 560px; font-size: clamp(1rem, 2vw, 1.2rem); color: var(--muted); margin-bottom: 36px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 14px 26px;
  border-radius: 999px; font-weight: 600; font-size: .98rem; cursor: pointer;
  border: 1px solid transparent; transition: transform .25s var(--ease), box-shadow .3s, background .3s;
}
.btn--primary { background: var(--grad); color: #fff; background-size: 150% auto; box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn--primary:hover { transform: translateY(-3px); background-position: right center; box-shadow: 0 18px 40px -10px color-mix(in srgb, var(--accent-2) 70%, transparent); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { transform: translateY(-3px); border-color: var(--accent); }
.btn--lg { padding: 18px 34px; font-size: 1.15rem; font-family: 'Space Grotesk'; }

.scroll-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.scroll-hint__line { width: 1px; height: 40px; background: linear-gradient(var(--accent), transparent); animation: drop 2s ease-in-out infinite; }
@keyframes drop { 0%,100%{ transform: scaleY(.4); opacity:.4; transform-origin: top;} 50%{ transform: scaleY(1); opacity:1;} }

/* ============================================================
   ABOUT
============================================================ */
.about__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(30px, 6vw, 70px); align-items: center; }
.about__media { position: relative; }
.about__photo {
  aspect-ratio: 4/5; border-radius: var(--radius); border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%),
    radial-gradient(circle at 80% 90%, color-mix(in srgb, var(--accent-2) 40%, transparent), transparent 55%),
    var(--bg-soft);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem;
  box-shadow: var(--shadow); overflow: hidden;
}
.about__photo img { width: 100%; height: 100%; object-fit: cover; display: block;
}
.about__badge { position: absolute; bottom: -18px; right: -18px; width: 64px; height: 64px; border-radius: 18px;
  background: var(--bg-soft); border: 1px solid var(--border); display: grid; place-items: center; font-size: 1.7rem; box-shadow: var(--shadow); animation: float1 6s ease-in-out infinite; }

.lead { font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 500; margin-bottom: 18px; font-family: 'Space Grotesk'; }
.about__text p { color: var(--muted); margin-bottom: 16px; }
.about__stats { display: flex; gap: 34px; margin-top: 30px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-family: 'Space Grotesk'; font-size: 2rem; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { font-size: .85rem; color: var(--muted); }

/* ============================================================
   PROJECTS
============================================================ */
.projects__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px; }
.card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--border);
  transition: transform .4s var(--ease), border-color .4s, box-shadow .4s;
}
.card:hover { transform: translateY(-8px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: var(--shadow); }
.card__visual { height: 190px; display: grid; place-items: center; position: relative; overflow: hidden; }
.card__visual::after { content:''; position:absolute; inset:0; background: linear-gradient(to top, var(--bg-soft), transparent 60%); }
.card__visual--a { background: linear-gradient(135deg, #7C5CFC, #23D5EE); }
.card__visual--b { background: linear-gradient(135deg, #FF5D9E, #FFC65C); }
.card__visual--c { background: linear-gradient(135deg, #23D5EE, #33e08a); }
.card__emoji { font-size: 3.4rem; z-index: 1; transition: transform .5s var(--ease); }
.card:hover .card__emoji { transform: scale(1.15) rotate(-6deg); }
.card__body { padding: 22px; }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card__title { font-size: 1.3rem; font-weight: 600; }
.card__link { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); flex-shrink: 0; transition: .3s var(--ease); }
.card:hover .card__link { background: var(--accent); color: #fff; border-color: var(--accent); }
.card__desc { color: var(--muted); font-size: .95rem; margin-bottom: 16px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: .78rem; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }

/* ============================================================
   SKILLS
============================================================ */
.skills__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-bottom: 60px; }
.skillcat { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color .3s, transform .3s var(--ease); }
.skillcat:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-4px); }
.skillcat h3 { font-size: 1.05rem; margin-bottom: 16px; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .85rem; padding: 7px 13px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--border); transition: .25s var(--ease); cursor: default; }
.chip:hover { background: var(--grad); color: #fff; border-color: transparent; transform: translateY(-2px); }

.marquee { overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 20px 0; }
.marquee__track { display: flex; gap: 40px; width: max-content; animation: scroll-x 22s linear infinite; }
.marquee__track span { font-family: 'Space Grotesk'; font-size: 1.6rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.marquee__track span:nth-child(odd) { color: var(--accent); }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ============================================================
   CONTACT
============================================================ */
.contact { text-align: center; }
.contact__inner { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.contact .section__num { margin-bottom: 18px; }
.contact__title { font-size: clamp(2.4rem, 7vw, 5rem); font-weight: 700; line-height: 1; margin-bottom: 22px; }
.contact__title .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contact__sub { color: var(--muted); font-size: 1.15rem; margin-bottom: 34px; }
.contact__socials { display: flex; gap: 24px; margin-top: 30px; }
.contact__socials a { color: var(--muted); font-weight: 500; position: relative; transition: color .25s; }
.contact__socials a:hover { color: var(--text); }
.contact__socials a::after { content:''; position:absolute; left:0; bottom:-4px; width:0; height:2px; background: var(--grad); transition: width .3s var(--ease); }
.contact__socials a:hover::after { width: 100%; }

/* ============================================================
   FOOTER
============================================================ */
.footer { max-width: var(--maxw); margin: 0 auto; padding: 34px clamp(20px, 5vw, 48px); display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; flex-wrap: wrap; gap: 12px; }
.footer__top { transition: color .25s; }
.footer__top:hover { color: var(--text); }

/* ============================================================
   REVEAL ANIMATION
============================================================ */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.card.reveal { transition-delay: calc(var(--i) * .1s); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 820px) {
  .nav__links { position: fixed; inset: 0 0 0 auto; width: min(75vw, 300px);
    flex-direction: column; justify-content: center; gap: 8px; padding: 40px;
    background: var(--bg-soft); border-left: 1px solid var(--border);
    transform: translateX(100%); transition: transform .4s var(--ease); }
  .nav__links.open { transform: translateX(0); }
  .nav__links a { font-size: 1.2rem; }
  .nav__burger { display: flex; }
  .about__grid { grid-template-columns: 1fr; }
  .about__media { max-width: 340px; }
  .footer { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
