:root {
  --bg: #050816;
  --bg-soft: #0c1126;
  --panel: rgba(16, 21, 44, 0.78);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #f5f7ff;
  --muted: #a8b1d8;
  --primary: #8b5cf6;
  --primary-2: #a855f7;
  --secondary: #3b82f6;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  --radius: 22px;
  --container: 1180px;
  --header-h: 76px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

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

/* Fond */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -30;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(168, 85, 247, 0.16), transparent 22%),
    radial-gradient(circle at 80% 18%, rgba(59, 130, 246, 0.1), transparent 20%),
    linear-gradient(180deg, #050816 0%, #070b18 50%, #050816 100%);
}

#neuralCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -20;
  pointer-events: none;
  opacity: 0.9;
}

header,
main,
footer {
  position: relative;
  z-index: 10;
}

/* Curseur normal + halo */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(168,85,247,0.28) 0%, rgba(59,130,246,0.12) 45%, rgba(59,130,246,0) 75%);
  box-shadow:
    0 0 24px rgba(168, 85, 247, 0.35),
    0 0 40px rgba(59, 130, 246, 0.15);
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
  opacity: 0.3;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.28;
  animation: floatOrb 9s ease-in-out infinite;
}

.orb-1 {
  width: 280px;
  height: 280px;
  top: 10%;
  left: -4%;
  background: rgba(168, 85, 247, 0.42);
}

.orb-2 {
  width: 340px;
  height: 340px;
  top: 16%;
  right: -8%;
  background: rgba(59, 130, 246, 0.26);
  animation-delay: 1.5s;
}

.orb-3 {
  width: 280px;
  height: 280px;
  bottom: 5%;
  left: 34%;
  background: rgba(139, 92, 246, 0.24);
  animation-delay: 3s;
}

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

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.section {
  padding: 110px 0;
  position: relative;
  z-index: 11;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(5, 8, 22, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  transition: 0.25s ease;
}

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

.menu-btn {
  display: none;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

main {
  padding-top: var(--header-h);
}

.hero {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  padding-top: 30px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  color: #c4b5fd;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

h1, h2, h3 {
  margin: 0 0 1rem;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.7rem, 5vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

h1 span {
  display: block;
  margin-top: 0.65rem;
  color: #d6dcff;
  font-size: clamp(1.1rem, 2vw, 1.7rem);
  font-weight: 600;
  line-height: 1.35;
}

h2 {
  font-size: clamp(2rem, 3vw, 3rem);
}

.hero-description,
.panel p,
.timeline-item p,
.timeline-item li,
.project-card p,
.contact-box p,
.footer p,
.section-heading p {
  color: var(--muted);
}

.hero-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.95rem;
  margin: 1.6rem 0 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.95rem 1.3rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2) 58%, var(--secondary));
  color: white;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 34px rgba(124, 58, 237, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.btn-sm {
  padding: 0.8rem 1rem;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.panel,
.contact-box,
.photo-card {
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  z-index: 12;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 2rem;
}

.about-grid,
.skills-grid,
.projects-grid {
  display: grid;
  gap: 1.2rem;
}

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

.projects-grid {
  grid-template-columns: repeat(3, 1fr);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.tags span {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(38, 47, 86, 0.98), rgba(73, 37, 119, 0.96));
  border: 1px solid rgba(196, 181, 253, 0.3);
  color: #f8faff;
  font-size: 0.94rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 8px 18px rgba(0,0,0,0.22);
}

.tags span i {
  color: #d8c8ff;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-date {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.14);
  color: #ddd6fe;
  font-size: 0.92rem;
  font-weight: 700;
}

.timeline-item ul {
  margin: 0;
  padding-left: 1.15rem;
}

.project-card h3,
.panel h3,
.contact-box h2,
.timeline-item h3 {
  color: var(--text);
}

.contact-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.footer {
  padding: 2rem 0 3rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.photo-card {
  position: relative;
  width: min(100%, 430px);
  padding: 0.8rem;
}

.photo-ring {
  position: absolute;
  inset: -1px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(168,85,247,0.9), rgba(59,130,246,0.5));
  filter: blur(20px);
  opacity: 0.35;
  z-index: 0;
}

.profile-photo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5.2;
  object-fit: cover;
  object-position: center top;
  border-radius: 18px;
}

.scroll-indicator {
  width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  color: #d9ddff;
  opacity: 0.9;
  transition: opacity 0.25s ease;
}

.scroll-indicator span {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #b9c2f2;
}

.scroll-indicator i {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 1rem;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2) 58%, var(--secondary));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 12px 28px rgba(124, 58, 237, 0.28);
  animation: bounceArrow 1.8s ease-in-out infinite;
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  margin: 0;
  z-index: 20;
}

@keyframes bounceArrow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(7px);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

@media (max-width: 1080px) {
  .hero-grid,
  .about-grid,
  .skills-grid,
  .projects-grid,
  .contact-box,
  .footer-inner {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .hero {
    min-height: auto;
    padding-top: 2rem;
    padding-bottom: 5rem;
  }
}

@media (max-width: 840px) {
  .cursor-glow {
    display: none;
  }

  .menu-btn {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: var(--header-h);
    left: 1rem;
    right: 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(8, 11, 24, 0.96);
    border: 1px solid rgba(255,255,255,0.08);
    z-index: 1200;
  }

  .nav-links.open {
    display: flex;
  }

  .section {
    padding: 88px 0;
  }

  .hero-scroll {
    bottom: 14px;
  }
}