/* Refonte visuelle premium */
:root {
  --bg-base: #060913;
  --bg-surface: #0b1120;
  --bg-card: #111a31;
  --text-primary: #f6f8ff;
  --text-secondary: #b8c2e4;
  --text-muted: #8a96bd;
  --accent: #7c8cff;
  --accent-light: #a8b1ff;
  --cyan: #36e2d1;
  --gradient: linear-gradient(135deg, #7c8cff 0%, #36e2d1 100%);
  --gradient-text: linear-gradient(135deg, #c3c9ff 0%, #84f3ea 100%);
  --border: rgba(159, 170, 255, 0.2);
  --card-shadow: 0 18px 42px rgba(5, 8, 18, 0.46);
  --card-shadow-hover: 0 26px 58px rgba(4, 8, 20, 0.58);
}

body {
  background:
    radial-gradient(1200px 720px at 0% -10%, rgba(124, 140, 255, 0.2), transparent 62%),
    radial-gradient(1050px 620px at 100% 0%, rgba(54, 226, 209, 0.16), transparent 60%),
    var(--bg-base);
}

.navbar {
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(6, 9, 19, 0.86);
  border-bottom: 1px solid var(--border);
}

.nav-links a {
  color: #aeb9df;
}

.nav-links a:hover,
.nav-links a.active {
  color: #f4f7ff;
}

.nav-links .nav-cv-link {
  border: 1px solid rgba(168, 177, 255, 0.42);
  background: rgba(124, 140, 255, 0.12);
  color: #e7ebff;
}

.nav-links .nav-cv-link:hover {
  border-color: rgba(168, 177, 255, 0.72);
  background: rgba(124, 140, 255, 0.2);
}

.nav-cta {
  box-shadow: 0 10px 24px rgba(124, 140, 255, 0.28);
}

.hero {
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(620px 300px at 25% 26%, rgba(124, 140, 255, 0.16), transparent 70%),
    radial-gradient(680px 320px at 78% 22%, rgba(54, 226, 209, 0.14), transparent 72%);
}

.hero h1 {
  font-size: clamp(3rem, 6.2vw, 5.35rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.hero .gradient-text {
  filter: drop-shadow(0 8px 34px rgba(124, 140, 255, 0.26));
}

.hero-subtitle {
  font-size: 1.08rem;
  max-width: 68ch;
  color: #c5cdea;
}

.hero-badge {
  background: rgba(54, 226, 209, 0.1);
  border-color: rgba(54, 226, 209, 0.34);
}

.hero-actions {
  gap: 16px;
}

.btn {
  border-radius: 12px;
}

.btn-primary {
  background: var(--gradient);
  box-shadow: 0 14px 32px rgba(124, 140, 255, 0.3);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-primary:hover {
  box-shadow: 0 22px 45px rgba(124, 140, 255, 0.4);
}

.btn-primary::before,
.nav-cta::before {
  content: "";
  position: absolute;
  inset: -1px auto -1px -50%;
  width: 45%;
  transform: translateX(-170%) skewX(-20deg);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.34),
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.btn-primary:hover::before,
.nav-cta:hover::before {
  transform: translateX(430%) skewX(-20deg);
}

.btn-outline {
  border-color: rgba(190, 202, 255, 0.32);
}

.btn-outline:hover {
  border-color: rgba(168, 177, 255, 0.64);
}

.terminal-window {
  border: 1px solid rgba(124, 140, 255, 0.34);
  box-shadow:
    0 30px 70px rgba(4, 7, 18, 0.56),
    0 0 0 1px rgba(124, 140, 255, 0.08);
  animation: terminalGlow 5.6s ease-in-out infinite;
}

@keyframes terminalGlow {
  0%,
  100% {
    box-shadow:
      0 30px 70px rgba(4, 7, 18, 0.56),
      0 0 0 1px rgba(124, 140, 255, 0.08);
  }
  50% {
    box-shadow:
      0 32px 76px rgba(4, 7, 18, 0.6),
      0 0 38px rgba(124, 140, 255, 0.2);
  }
}

.metrics {
  background:
    linear-gradient(180deg, rgba(124, 140, 255, 0.08) 0%, rgba(54, 226, 209, 0.05) 100%),
    var(--bg-surface);
}

.metric {
  border-radius: 16px;
  transition: transform 0.35s ease, background 0.35s ease;
}

.metric:hover {
  transform: translateY(-4px);
  background: rgba(124, 140, 255, 0.06);
}

.metric-value {
  font-size: 2.15rem;
}

.section-header {
  max-width: 760px;
}

.section-header h2 {
  font-size: clamp(2.3rem, 4.1vw, 3.25rem);
  text-wrap: balance;
}

.section-header > p {
  color: #c0c9e8;
}

.services-grid,
.portfolio-grid {
  gap: 24px;
}

.service-card,
.portfolio-card,
.testimonial-card,
.contact-form-wrap,
.solution-card,
.faq-item,
.offer-card,
.tech-card {
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}

.service-card:hover,
.portfolio-card:hover,
.testimonial-card:hover,
.solution-card:hover,
.tech-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
}

.service-card,
.solution-card,
.portfolio-card,
.testimonial-card {
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.38s ease, border-color 0.3s ease;
  --mouse-x: 50%;
  --mouse-y: 50%;
  background-image: radial-gradient(
    500px circle at var(--mouse-x) var(--mouse-y),
    rgba(124, 140, 255, 0.1),
    transparent 42%
  );
}

.code-window,
.solution-mockup {
  border: 1px solid rgba(124, 140, 255, 0.3);
}

.offer-card {
  border-color: rgba(168, 177, 255, 0.28);
}

.faq-item[open] {
  box-shadow: 0 22px 40px rgba(4, 8, 20, 0.44);
}

.metrics.metrics-live .metric.active {
  animation: metricPop 0.7s cubic-bezier(0.18, 0.9, 0.24, 1) both;
}

.metrics.metrics-live .metric.active .metric-icon {
  animation: metricIconPulse 1.4s ease-in-out 2;
}

@keyframes metricPop {
  0% {
    transform: translateY(14px) scale(0.96);
    opacity: 0.7;
  }
  70% {
    transform: translateY(-2px) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes metricIconPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(124, 140, 255, 0);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 24px rgba(124, 140, 255, 0.35);
  }
}

.contact {
  background:
    radial-gradient(950px 520px at 100% 100%, rgba(124, 140, 255, 0.18), transparent 60%),
    var(--bg-surface);
}

.contact-form-wrap {
  background: linear-gradient(180deg, rgba(17, 26, 49, 0.94), rgba(13, 21, 40, 0.94));
}

input,
select,
textarea {
  border-color: rgba(168, 177, 255, 0.28);
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.24);
}

.footer {
  background: #05070f;
}

.footer-bottom {
  border-top: 1px solid var(--border);
}

/* Accessibilité */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.nav-links a:focus-visible,
.btn:focus-visible,
.service-link:focus-visible,
.footer a:focus-visible {
  outline-color: var(--accent-light);
}

/* Cascade cinematique */
.hero-left > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-left.cinematic-in > * {
  opacity: 1;
  transform: translateY(0);
}

.hero-left.cinematic-in > *:nth-child(1) { transition-delay: 80ms; }
.hero-left.cinematic-in > *:nth-child(2) { transition-delay: 160ms; }
.hero-left.cinematic-in > *:nth-child(3) { transition-delay: 240ms; }
.hero-left.cinematic-in > *:nth-child(4) { transition-delay: 320ms; }
.hero-left.cinematic-in > *:nth-child(5) { transition-delay: 400ms; }

.section-header .section-tag,
.section-header h2,
.section-header > p {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-header.cinematic-in .section-tag { opacity: 1; transform: translateY(0); transition-delay: 60ms; }
.section-header.cinematic-in h2 { opacity: 1; transform: translateY(0); transition-delay: 140ms; }
.section-header.cinematic-in > p { opacity: 1; transform: translateY(0); transition-delay: 220ms; }

/* Lignes de separation animees */
.services,
.solutions,
.portfolio,
.contact,
.tech-stack,
.testimonials {
  position: relative;
}

.services::before,
.solutions::before,
.portfolio::before,
.contact::before,
.tech-stack::before,
.testimonials::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 140, 255, 0.6), rgba(54, 226, 209, 0.5), transparent);
  background-size: 200% 100%;
  animation: separatorFlow 7s linear infinite;
}

@keyframes separatorFlow {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* Mobile/tablette */
@media (max-width: 1024px) {
  .hero h1 {
    font-size: clamp(2.55rem, 7.2vw, 4.2rem);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-header h2 {
    font-size: clamp(2rem, 5.6vw, 2.8rem);
  }
}

@media (max-width: 768px) {
  .hero {
    padding-top: 92px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 8vw, 3.45rem);
  }

  .hero-actions {
    gap: 12px;
  }

  .btn {
    padding: 13px 22px;
  }

  .service-card,
  .solution-card,
  .portfolio-card,
  .testimonial-card,
  .contact-form-wrap,
  .offer-card {
    border-radius: 14px;
  }

  .section-header {
    margin-bottom: 52px;
  }
}

@media (max-width: 480px) {
  .services::before,
  .solutions::before,
  .portfolio::before,
  .contact::before,
  .tech-stack::before,
  .testimonials::before {
    left: 6%;
    width: 88%;
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .hero-subtitle {
    font-size: 0.98rem;
  }

  .section-header h2 {
    font-size: clamp(1.8rem, 9vw, 2.35rem);
  }
}
