:root {
  --bg: #080f1f;
  --surface: #101b36;
  --surface-2: #122146;
  --text: #eff3ff;
  --muted: #b8c2e5;
  --primary: #4fd1ff;
  --accent: #8a6bff;
  --border: rgba(255, 255, 255, 0.15);
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
  --input-bg: #0e1a39;
  --header-bg: rgba(8, 15, 31, 0.88);
}
html[data-theme="light"] {
  --bg: #eef3ff;
  --surface: #ffffff;
  --surface-2: #f3f6ff;
  --text: #0d1b3d;
  --muted: #334975;
  --primary: #2d74ff;
  --accent: #825fff;
  --border: rgba(16, 32, 65, 0.22);
  --shadow: 0 12px 24px rgba(18, 39, 76, 0.12);
  --input-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.88);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at 10% 5%, color-mix(in srgb, var(--primary) 28%, var(--bg)), var(--bg) 42%);
  color: var(--text);
  line-height: 1.6;
  animation: page-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 15% -15%, color-mix(in srgb, var(--primary) 26%, transparent), transparent 52%),
    radial-gradient(ellipse 70% 45% at 92% 105%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 48%),
    radial-gradient(ellipse 50% 40% at 50% 50%, color-mix(in srgb, var(--primary) 6%, transparent), transparent 65%);
  animation: mesh-drift 22s ease-in-out infinite alternate;
}
@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes mesh-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  100% { transform: translate3d(-2%, 1%, 0) scale(1.03); opacity: 0.92; }
}
a { color: inherit; text-decoration: none; }
.container { width: min(1140px, 92%); margin: 0 auto; }

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px) saturate(1.2);
  background: var(--header-bg);
  animation: header-slide 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition:
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    backdrop-filter 0.35s ease;
}
.body--scrolled .header {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  border-bottom-color: color-mix(in srgb, var(--primary) 18%, var(--border));
}
html[data-theme="light"] .body--scrolled .header {
  box-shadow: 0 10px 36px rgba(18, 39, 76, 0.12);
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover {
  transform: translateY(-1px);
}
.brand img { width: 42px; height: 42px; object-fit: contain; border-radius: 8px; }
.brand h1 { font-size: 1.3rem; line-height: 1.1; }
.brand p { color: var(--primary); font-size: 0.8rem; }
.nav-links { display: flex; gap: 1.1rem; color: var(--muted); }
.nav-links a {
  position: relative;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  transition: color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.28rem;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: translateX(-50%);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: rgba(79, 209, 255, 0.1);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 70%;
}
.btn {
  border: 1px solid var(--border);
  padding: 0.62rem 0.95rem;
  border-radius: 10px;
  font-weight: 600;
  background: transparent;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}
.btn:not(.theme-toggle--icon):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}
.btn-primary {
  background: linear-gradient(130deg, #4fd1ff, #866dff);
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
  color: #041126;
  border-color: transparent;
}
.btn-primary:hover {
  box-shadow: 0 14px 38px color-mix(in srgb, var(--primary) 42%, transparent);
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.btn-login {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 25%, transparent);
  border-color: color-mix(in srgb, var(--primary) 65%, var(--border));
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.btn-danger {
  border-color: color-mix(in srgb, #f87171 50%, var(--border));
  color: #fecaca;
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.15);
}
.theme-toggle--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.theme-toggle--icon:hover {
  transform: scale(1.06);
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 22%, transparent);
}
.theme-toggle--icon .theme-icon--moon[hidden],
.theme-toggle--icon .theme-icon--sun[hidden] {
  display: none !important;
}

.hero { padding: 5rem 0 2.6rem; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.4rem; align-items: center; }
.hero--about { padding: 4.5rem 0 2rem; }
.hero-grid--about { align-items: center; }
.hero--about .about-intro { max-width: 62ch; }
.hero--about #aboutHeroImage {
  min-height: 320px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.badge {
  display: inline-block;
  border: 1px solid rgba(79, 209, 255, 0.45);
  color: var(--primary);
  background: rgba(79, 209, 255, 0.1);
  border-radius: 999px;
  padding: 0.36rem 0.76rem;
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
  animation: badge-glow 4s ease-in-out infinite;
}
@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 35%, transparent); }
  50% { box-shadow: 0 0 20px 2px color-mix(in srgb, var(--primary) 18%, transparent); }
}
h2 { font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.15; margin-bottom: 0.8rem; letter-spacing: -0.02em; }
.hero-lead.show .badge {
  animation:
    hero-stagger 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    badge-glow 4s ease-in-out 0.75s infinite;
}
.hero-lead.show #heroTitle {
  animation: hero-stagger 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}
.hero-lead.show #heroText {
  animation: hero-stagger 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}
.hero-lead.show .hero-cta {
  animation: hero-stagger 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}
@keyframes hero-stagger {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hero p { color: var(--muted); max-width: 68ch; }
.hero-logo {
  width: min(320px, 75%);
  height: auto;
  margin-bottom: 0.9rem;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}
.hero-image {
  min-height: 310px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(rgba(14, 25, 54, 0.35), rgba(14, 25, 54, 0.35)), url("gallery/meeting-screen.png") center / cover no-repeat;
  box-shadow: var(--shadow);
}

section { padding: 3rem 0; }
main > section:nth-child(even) {
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--surface) 42%, transparent) 45%,
    transparent
  );
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}
.reveal.section-title.show::after,
section .section-title.reveal.show::after {
  content: "";
  display: block;
  height: 3px;
  width: 0;
  margin-top: 0.45rem;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  animation: title-line 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
section .section-title.reveal:not(.show)::after {
  display: none;
}
@keyframes title-line {
  to { width: min(4.5rem, 28%); }
}
.section-subtitle { color: var(--muted); margin-bottom: 1.2rem; max-width: 70ch; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(17, 31, 62, 0.94), rgba(17, 31, 62, 0.72));
  box-shadow: var(--shadow);
  padding: 1rem;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease,
    border-color 0.35s ease;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 38%,
    color-mix(in srgb, var(--primary) 12%, transparent) 48%,
    transparent 58%
  );
  transform: translateX(-120%) skewX(-12deg);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.28),
    0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent);
}
.card:hover::after {
  transform: translateX(120%) skewX(-12deg);
}

/* Panneau admin : pas d'overlay ::after (sinon les boutons Modifier / Supprimer ne réagissent pas fiabillement) */
#adminRoot .card::after,
.admin-wrap .card::after {
  display: none !important;
  content: none !important;
}
#adminRoot .card:hover,
.admin-wrap .card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
#adminRoot .card:hover .project-cover img,
#adminRoot .card:hover .service-icon {
  transform: none;
}
#adminRoot .admin-item-actions {
  position: relative;
  z-index: 2;
}
.service-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: linear-gradient(130deg, #4fd1ff, #8a6bff);
  margin-bottom: 0.7rem;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 22%, transparent);
}
.card:hover .service-icon {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 35%, transparent);
}
.card p { color: var(--muted); }
.meta { color: var(--primary); font-weight: 600; font-size: 0.85rem; }
.project-cover {
  height: 170px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.7rem;
  background: var(--surface-2);
}
.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s cubic-bezier(0.33, 1, 0.68, 1);
}
.card:hover .project-cover img {
  transform: scale(1.08);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { text-align: center; }
.stat-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 28px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: transform 0.35s ease;
}
.stat-card:hover .value {
  transform: scale(1.06);
}
.theme-toggle { min-width: 44px; }

.contact-list { list-style: none; display: grid; gap: 0.65rem; color: var(--muted); }
.footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 1.1rem 0;
  text-align: center;
}
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface) 40%, transparent));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr 0.9fr;
  gap: 1.5rem;
  padding: 2.5rem 0 1.5rem;
  text-align: left;
}
.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.footer-brand-block .footer-desc {
  color: var(--muted);
  margin-top: 0.75rem;
  font-size: 0.92rem;
  max-width: 36ch;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.footer-brand strong {
  display: block;
  font-size: 1.05rem;
}
.footer-brand p {
  color: var(--primary);
  font-size: 0.82rem;
  margin: 0;
}
.footer-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.footer-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 0.15rem;
}
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.footer-nav a {
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.footer-nav a:hover {
  color: var(--primary);
  transform: translateX(4px);
}
.footer-social {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.footer-social a {
  color: var(--muted);
}
.footer-social a:hover {
  color: var(--primary);
}
.footer-bar {
  border-top: 1px solid var(--border);
  padding: 0.85rem 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.show {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}
.anim-float {
  animation: float-y 5s ease-in-out infinite;
}
.anim-float-slow {
  animation: float-y 7s ease-in-out infinite;
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.anim-pulse {
  animation: pulse-op 1.2s ease-in-out infinite;
}
@keyframes pulse-op {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes header-slide {
  from { transform: translateY(-8px); opacity: 0.85; }
  to { transform: translateY(0); opacity: 1; }
}
.admin-gate { max-width: 480px; margin: 0 auto 1rem; }
.admin-checking { text-align: center; padding: 2rem; }
.admin-login-card { padding: 1.5rem; }
.admin-root { margin-top: 0.5rem; }
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.admin-dynamic-list {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.admin-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
}
@media (max-width: 720px) {
  .admin-row {
    grid-template-columns: 1fr;
  }
}
.admin-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.admin-item-card .project-cover {
  margin-bottom: 0.5rem;
}

html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .nav-links a.active {
  background: rgba(45, 116, 255, 0.14);
  color: #1749ad;
}

html[data-theme="light"] .card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 255, 0.98));
}

html[data-theme="light"] .btn {
  color: #1a2e5f;
}

html[data-theme="light"] .btn-primary {
  color: #ffffff;
}

html[data-theme="light"] .badge {
  background: rgba(45, 116, 255, 0.12);
  border-color: rgba(45, 116, 255, 0.28);
  color: #1749ad;
}

html[data-theme="light"] .meta {
  color: #1f5fda;
}

.admin-wrap { padding: 2rem 0 3rem; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-form { display: grid; gap: 0.6rem; }
label { color: var(--muted); font-size: 0.9rem; }
input, textarea, select {
  width: 100%;
  padding: 0.66rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
}
textarea { min-height: 100px; resize: vertical; }

@media (max-width: 950px) {
  .hero-grid, .grid-3, .admin-grid, .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .hero-grid, .grid-3, .admin-grid, .stats-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  body,
  body::before {
    animation: none !important;
  }
  .header {
    animation: none !important;
  }
  .badge {
    animation: none !important;
  }
  .btn-primary {
    animation: none !important;
  }
  .hero-lead.show .badge,
  .hero-lead.show #heroTitle,
  .hero-lead.show #heroText,
  .hero-lead.show .hero-cta {
    animation: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }
  .reveal.section-title.show::after,
  section .section-title.reveal.show::after {
    animation: none !important;
    width: min(4.5rem, 28%) !important;
  }
  .card::after {
    display: none !important;
  }
  .card:hover {
    transform: none !important;
  }
  .card:hover .project-cover img,
  .card:hover .service-icon,
  .stat-card:hover .value {
    transform: none !important;
  }
  .nav-links a::after {
    transition: none !important;
  }
}
