/* =========================================================
   LRDev — feuille de style
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --blue: #1762ec;
  /* Bleu clair utilisé pour le texte : contraste vérifié ≥ 4.5:1 sur tous
     les fonds du site (WCAG AA). */
  --blue-light: #7aa7ff;
  /* Bleu vif réservé aux grands titres et aux éléments décoratifs. */
  --blue-vivid: #4f8bff;
  --blue-dark: #0f47ad;

  --bg: #23272e;
  --bg-alt: #1b1e24;
  --surface: #2d323b;
  --surface-2: #363c47;
  --border: #434a57;

  --text: #f2f4f7;
  --text-muted: #b3bac6;
  --text-dim: #8b93a1;

  --radius: 14px;
  --radius-lg: 22px;

  --shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.42);
  --shadow-blue: 0 10px 30px rgba(23, 98, 236, 0.32);

  --container: 1180px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 9vw, 6.5rem);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Titillium Web", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0 0 0.6em;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.9rem);
  font-weight: 900;
}
h2 {
  font-size: clamp(1.65rem, 1.15rem + 2.1vw, 2.6rem);
}
h3 {
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
  font-weight: 600;
}

p {
  margin: 0 0 1.1em;
  text-wrap: pretty;
}

a {
  color: var(--blue-light);
  text-underline-offset: 3px;
}
a:hover {
  color: #a3c1ff;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Utilitaires ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.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: 50%;
  top: 0;
  transform: translate(-50%, -140%);
  z-index: 999;
  background: var(--blue);
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.skip-link:focus {
  transform: translate(-50%, 0);
  color: #fff;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue-light);
  margin-bottom: 0.75rem;
}

.accent {
  color: var(--blue-vivid);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section-alt {
  background: var(--bg-alt);
}

.section-alt-soft {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.section-intro {
  color: var(--text-muted);
  max-width: 62ch;
  font-size: 1.05em;
  margin-bottom: 2.75rem;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.7rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease,
    box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
  background: var(--blue-dark);
  color: #fff;
  transform: translateY(-2px);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--blue-light);
  color: var(--text);
  background: rgba(23, 98, 236, 0.12);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.92rem;
}
.btn-lg {
  padding: 1.05rem 2.2rem;
  font-size: 1.08rem;
}

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(27, 30, 36, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}
.brand:hover {
  color: var(--text);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
}

.site-nav a:not(.btn) {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.site-nav a:not(.btn):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav-toggle-bars {
  top: 50%;
  transform: translate(-50%, -50%);
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  left: 0;
}
.nav-toggle-bars::before {
  top: -6px;
}
.nav-toggle-bars::after {
  top: 6px;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 10vw, 7rem);
  background:
    radial-gradient(
      ellipse 70% 90% at 78% 8%,
      rgba(23, 98, 236, 0.3),
      transparent 62%
    ),
    radial-gradient(
      ellipse 60% 70% at 8% 92%,
      rgba(79, 139, 255, 0.16),
      transparent 60%
    );
}

.hero-inner {
  max-width: 900px;
}

.hero h1 {
  margin-bottom: 0.5em;
}

.lead {
  font-size: clamp(1.08rem, 1rem + 0.55vw, 1.35rem);
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 3.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.stats strong {
  display: block;
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem);
  font-weight: 900;
  line-height: 1;
  color: var(--blue-light);
  margin-bottom: 0.35rem;
}
.stats span {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ---------- Cartes services ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, border-color 0.22s ease,
    box-shadow 0.22s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--blue);
  box-shadow: var(--shadow-lg);
}
.card-icon {
  display: block;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 1rem;
}
.card p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* ---------- Étiquettes ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin-top: 1.25rem;
}
.tags li {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(23, 98, 236, 0.16);
  border: 1px solid rgba(79, 139, 255, 0.34);
  color: #a9c6ff;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.tags-lg li {
  font-size: 0.95rem;
  padding: 0.45rem 1.05rem;
}

/* Technologies secondaires : présentes, mais visuellement en retrait. */
.tags-muted li {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-muted);
}

.tech-label {
  margin: 1.5rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.tech-label + .tags {
  margin-top: 0.7rem;
}

/* ---------- Vagues décoratives ---------- */
.wave {
  position: absolute;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
}
.wave svg {
  display: block;
  width: calc(100% + 1.3px);
  height: 70px;
}
.wave svg path {
  fill: var(--blue);
}
.wave-top {
  top: 0;
}
.wave-bottom {
  bottom: 0;
  transform: rotate(180deg);
}
.section-alt {
  padding-block: calc(var(--section-y) + 40px);
}

/* ---------- Projets ---------- */
.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

/* Deux colonnes dès qu'il y a la place : les 4 projets forment un carré. */
@media (min-width: 880px) {
  .projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }
}

.project {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease,
    border-color 0.22s ease;
}
.project:hover {
  transform: translateY(-5px);
  border-color: var(--blue);
  box-shadow: var(--shadow-lg);
}

.project-body {
  padding: 1.6rem 1.6rem 1.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-body p {
  color: var(--text-muted);
  font-size: 0.97rem;
}
.project-body .tags {
  margin-top: auto;
  padding-top: 1rem;
}
.project-link {
  margin: 1rem 0 0;
}
.project-link a {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid rgba(79, 139, 255, 0.4);
  padding-bottom: 2px;
}
.project-link a:hover {
  border-bottom-color: var(--blue-light);
}

/* ---------- Carrousel ---------- */
.carousel {
  position: relative;
  background: var(--surface-2);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.carousel-portrait {
  aspect-ratio: 4 / 3;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide.is-active {
  opacity: 1;
  visibility: visible;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.carousel:not(.carousel-portrait) .slide img {
  object-fit: cover;
  object-position: top center;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(15, 17, 21, 0.62);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}
.carousel-btn.prev {
  left: 8px;
}
.carousel-btn.next {
  right: 8px;
}
.carousel:hover .carousel-btn,
.carousel-btn:focus-visible {
  opacity: 1;
}
.carousel-btn:hover {
  background: var(--blue);
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 17, 21, 0.5);
}
.carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background-color 0.2s ease, width 0.2s ease;
}
.carousel-dots button[aria-selected="true"] {
  background: #fff;
  width: 20px;
  border-radius: 999px;
}

/* ---------- Étapes ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 1.9rem 1.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.step-num {
  position: absolute;
  top: -18px;
  left: 1.5rem;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
  box-shadow: var(--shadow-blue);
}
.steps h3 {
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
}
.steps p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- À propos ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.about-photo {
  margin: 0;
  text-align: center;
}
.about-photo img {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  margin-inline: auto;
  border: 3px solid var(--blue);
  box-shadow: var(--shadow-blue);
  background: var(--bg-alt);
}
.about-photo figcaption {
  margin-top: 1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.about-text p {
  color: var(--text-muted);
}
.about-text h3 {
  margin-top: 2rem;
  color: var(--text);
}

/* ---------- Contact ---------- */
.contact-box {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.contact-box .lead {
  margin-inline: auto;
}
.contact-actions {
  margin: 0 0 2.25rem;
}

.contact-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  list-style: none;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: left;
}
.contact-meta li {
  font-size: 0.92rem;
  color: var(--text-muted);
}
.contact-meta strong {
  display: block;
  color: var(--text);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}

/* ---------- Pied de page ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding-block: 3rem 2.25rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2rem;
  align-items: start;
}

.footer-brand {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}
.footer-brand img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  flex-shrink: 0;
}
.footer-brand p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.footer-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
}
.footer-nav a:hover {
  color: var(--blue-light);
  text-decoration: underline;
}

.footer-legal {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .site-nav.is-open {
    display: block;
  }
  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.6rem var(--gutter) 1.4rem;
  }
  .site-nav a:not(.btn) {
    padding: 0.85rem 0.5rem;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }
  .site-nav .btn {
    margin-top: 1rem;
    width: 100%;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-photo img {
    max-width: 190px;
  }

  .carousel-btn {
    opacity: 1;
    background: rgba(15, 17, 21, 0.55);
  }
}

@media (max-width: 480px) {
  .hero-actions .btn {
    width: 100%;
  }
  .wave svg {
    height: 44px;
  }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .card:hover,
  .project:hover,
  .btn:hover {
    transform: none;
  }
}

/* ---------- Impression ---------- */
@media print {
  .site-header,
  .nav-toggle,
  .carousel-btn,
  .carousel-dots,
  .wave,
  .skip-link {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card,
  .project,
  .steps li,
  .contact-box {
    border: 1px solid #ccc;
    box-shadow: none;
    background: #fff;
    color: #000;
  }
}
