/* =====================================================
   PORTFOLIO EDDY RAKOTOARIVONY — style.css
   Styles custom complémentaires à Tailwind CSS
   ===================================================== */

/* ── Variables CSS ── */
:root {
  --color-primary: #0F766E;
  --color-primary-dark: #115E59;
  --color-primary-light: #14B8A6;
  --color-bg: #F9FAFB;
  --color-bg-card: #FFFFFF;
  --color-text: #111827;
  --color-text-muted: #6B7280;
  --color-border: #E5E7EB;
  --color-code-bg: #1E293B;
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 10px 25px -5px rgba(15, 118, 110, 0.2), 0 4px 10px -2px rgba(15, 118, 110, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 12px;
  --radius-sm: 8px;
}

/* Dark mode */
.dark {
  --color-bg: #0F172A;
  --color-bg-card: #1E293B;
  --color-text: #F1F5F9;
  --color-text-muted: #94A3B8;
  --color-border: #334155;
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* ── Base ── */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color 0.3s, color 0.3s;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
}

/* ── Reading Progress Bar ── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── Header ── */
#main-header {
  background-color: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

#main-header.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.dark #main-header {
  background-color: var(--color-bg-card);
}

/* ── Header Brand Logo ── */
.header-brand {
  min-width: 0;
  flex-shrink: 0;
}

.header-logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  border-radius: 6px;
}

@media (min-width: 640px) {
  .header-logo {
    height: 40px;
    max-width: 160px;
  }
}

/* ── Nav Links ── */
.nav-link {
  color: var(--color-text-muted);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
  background-color: rgba(15, 118, 110, 0.08);
}

/* ── Theme Toggle ── */
#theme-toggle {
  width: 44px;
  height: 24px;
  background: var(--color-border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  padding: 0;
  flex-shrink: 0;
}

#theme-toggle.dark-active {
  background: var(--color-primary);
}

#theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

#theme-toggle.dark-active::after {
  left: 23px;
}

/* ── Hero Section ── */
#hero {
  background: linear-gradient(135deg, #0a5c55 0%, #0F766E 35%, #0D9488 65%, #0369a1 100%);
  position: relative;
  overflow: hidden;
}

/* Grille de fond avec masque radial */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 80%);
}

/* Orbes flottants */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(72px);
}

.hero-orb-1 {
  top: -8%;
  right: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.45) 0%, transparent 65%);
  animation: orbFloat 9s ease-in-out infinite;
}

.hero-orb-2 {
  bottom: -12%;
  left: -8%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.35) 0%, transparent 65%);
  animation: orbFloat 13s ease-in-out infinite reverse;
}

.hero-orb-3 {
  top: 45%;
  left: 50%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 65%);
  animation: orbFloat 17s ease-in-out infinite;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(25px, -35px) scale(1.06);
  }

  66% {
    transform: translate(-18px, 22px) scale(0.94);
  }
}

/* ── Hero : animations d'entrée décalées ── */
.hero-item {
  opacity: 0;
  transform: translateY(28px);
}

.js-ready .hero-item {
  animation: heroReveal 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--delay, 0) * 0.15s + 0.1s);
}

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Badge disponibilité */
.hero-badge {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2rem;
  letter-spacing: 0.01em;
}

/* Titre principal */
.hero-title {
  font-size: clamp(2rem, 7vw, 5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .hero-title {
    font-size: clamp(1.2rem, 6vw, 1.9rem);
    padding: 0 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}

.hero-name-accent {
  display: block;
  background: linear-gradient(90deg, #5eead4 0%, #67e8f9 50%, #a5f3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Sous-titre / typewriter */
.hero-subtitle-wrap {
  margin-bottom: 1.75rem;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  min-height: 2rem;
}

.hero-cursor {
  display: inline-block;
  color: #5eead4;
  font-weight: 300;
  margin-left: 1px;
  animation: cursorBlink 0.85s step-end infinite;
}

@keyframes cursorBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Badges technos */
.hero-tech-badge {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0.38rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  cursor: default;
}

.hero-tech-badge:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(94, 234, 212, 0.5);
  transform: translateY(-2px);
}

/* CTA hero (taille lg) */
.btn-hero {
  padding: 0.8rem 1.8rem;
  font-size: 0.97rem;
}

.btn-ghost-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-ghost-hero:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Séparateur */
.hero-divider {
  width: 80px;
  height: 1px;
  margin: 0 auto 2.5rem;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

/* Stats */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.hero-stat-value {
  display: flex;
  align-items: baseline;
  gap: 1px;
  line-height: 1;
}

.hero-stat-number {
  font-size: 2.1rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #5eead4;
  transition: color 0.2s;
}

.hero-stat-plus {
  font-size: 1.3rem;
  font-weight: 700;
  color: #5eead4;
  margin-bottom: 2px;
}

.hero-stat-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-stat-sep {
  width: 1px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

/* Scroll indicator (souris animée) */
.hero-scroll-wrap {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  animation: heroReveal 0.8s ease 1.2s both;
}

.hero-scroll-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
}

.hero-scroll-mouse {
  width: 22px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 11px;
  position: relative;
  overflow: hidden;
}

.hero-scroll-dot {
  width: 4px;
  height: 7px;
  background: rgba(94, 234, 212, 0.8);
  border-radius: 2px;
  position: absolute;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
  animation: scrollDot 2.2s ease-in-out infinite;
}

@keyframes scrollDot {
  0% {
    top: 5px;
    opacity: 1;
  }

  75% {
    top: 18px;
    opacity: 0;
  }

  100% {
    top: 5px;
    opacity: 0;
  }
}

/* ── Section Services ── */
#services {
  position: relative;
}

#services::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 40% at 15% 50%, rgba(15, 118, 110, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 85% 20%, rgba(20, 184, 166, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.dark #services::before {
  background:
    radial-gradient(ellipse 70% 40% at 15% 50%, rgba(15, 118, 110, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 85% 20%, rgba(20, 184, 166, 0.08) 0%, transparent 60%);
}

/* ── Service Cards ── */
.service-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.35s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Gradient glow au hover en arrière-plan */
.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.06) 0%, rgba(20, 184, 166, 0.04) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

/* Barre top */
.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
  z-index: 1;
}

.service-card>* {
  position: relative;
  z-index: 1;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 20px 40px -12px rgba(15, 118, 110, 0.25),
    0 8px 16px -4px rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.4);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card:hover::after {
  opacity: 1;
}

/* Badge numéroté */
.service-number {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-primary);
  opacity: 0.07;
  letter-spacing: -0.04em;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 0;
}

.service-card:hover .service-number {
  opacity: 0.12;
}

/* Icône */
.service-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12) 0%, rgba(20, 184, 166, 0.08) 100%);
  border: 1px solid rgba(15, 118, 110, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.35s ease,
    box-shadow 0.35s ease;
  color: var(--color-primary);
  flex-shrink: 0;
}

.service-card:hover .service-icon {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-color: transparent;
  color: white;
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 8px 20px -4px rgba(15, 118, 110, 0.4);
}

.service-icon svg {
  transition: transform 0.35s ease;
  stroke: currentColor;
}

/* Au hover : légère mise en avant de l'icône */
.service-card:hover .service-icon svg {
  transform: scale(1.05);
}

/* Titre service */
.service-card h3 {
  transition: color 0.25s ease;
}

.service-card:hover h3 {
  color: var(--color-primary) !important;
}

/* Lien "En savoir plus" */
.service-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  margin-top: 1rem;
  letter-spacing: 0.02em;
}

.service-more svg {
  transition: transform 0.25s ease;
}

.service-card:hover .service-more {
  opacity: 1;
  transform: translateY(0);
}

.service-card:hover .service-more svg {
  transform: translateX(3px);
}

/* Service card — flex colonne pour aligner les tags en bas */
.service-card-stacked {
  display: flex;
  flex-direction: column;
}

/* Tags technos dans les cards services */
.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: auto;
  padding-top: 0.875rem;
  border-top: 1px solid var(--color-border);
}

.service-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.6rem;
  border-radius: 9999px;
  background: rgba(15, 118, 110, 0.07);
  color: var(--color-primary);
  border: 1px solid rgba(15, 118, 110, 0.14);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.service-card:hover .service-tag {
  background: rgba(15, 118, 110, 0.13);
  border-color: rgba(15, 118, 110, 0.28);
  transform: scale(1.02);
}

.dark .service-tag {
  background: rgba(20, 184, 166, 0.1);
  color: #5eead4;
  border-color: rgba(20, 184, 166, 0.2);
}

.dark .service-card:hover .service-tag {
  background: rgba(20, 184, 166, 0.18);
  border-color: rgba(20, 184, 166, 0.35);
}

.dark .service-card:hover {
  box-shadow:
    0 20px 40px -12px rgba(20, 184, 166, 0.2),
    0 8px 16px -4px rgba(0, 0, 0, 0.4);
  border-color: rgba(20, 184, 166, 0.35);
}

.dark .service-card:hover h3 {
  color: #5eead4 !important;
}

.dark .service-more {
  color: #5eead4;
}

/* ── Carousel ── */
.carousel-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-slide {
  flex-shrink: 0;
}

.post-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-primary);
}

.post-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.post-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(15, 118, 110, 0.1);
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.post-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: 1rem;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  gap: 0.5rem;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  color: var(--color-text);
}

.carousel-btn:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.carousel-btn-prev {
  left: -22px;
}

.carousel-btn-next {
  right: -22px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1.5rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  padding: 0;
}

.carousel-dot.active {
  background: var(--color-primary);
  width: 24px;
  border-radius: 4px;
}

/* ── Contact Section ── */
.contact-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

select.contact-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.contact-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.contact-input.error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-error {
  color: #EF4444;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: none;
}

.field-error.show {
  display: block;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.3);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  text-decoration: none;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

/* ── Modal ── */
#modal-about {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#modal-about.open {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: relative;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  animation: slideDown 0.3s ease;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.skill-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(15, 118, 110, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(15, 118, 110, 0.2);
  margin: 0.25rem;
  transition: var(--transition);
}

.skill-badge:hover {
  background: var(--color-primary);
  color: white;
}

/* ── Mobile Menu ── */
#mobile-menu {
  display: none;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
}

#mobile-menu.open {
  display: block;
  animation: slideDown 0.2s ease;
}

/* ── Scroll Reveal ── */
/* Progressive enhancement : contenu visible par défaut.
   La classe html.js-ready active l'animation uniquement quand JS est chargé. */
.reveal {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js-ready .reveal {
  opacity: 0;
  transform: translateY(30px);
}

html.js-ready .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Footer ── */
footer {
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
}

/* ── Sections ── */
section {
  scroll-margin-top: 72px;
}

/* ── SINGLE POST PAGE ── */

/* Layout article + sidebar */
#main-content .post-body {
  display: flex !important;
  gap: 2.5rem;
  align-items: stretch;
  flex-wrap: nowrap;
}

#main-content .post-body>article {
  flex: 1 1 0% !important;
  min-width: 0;
}

#main-content .post-body>aside {
  display: none;
  flex-shrink: 0;
  width: 18rem;
  /* align-self: stretch est hérité → la sidebar a la hauteur de l'article */
  /* nécessaire pour que position:sticky fonctionne dans un flex container */
}

@media (min-width: 1024px) {
  #main-content .post-body>aside {
    display: block !important;
  }
}

/* Reading progress bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), #14b8a6);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* Breadcrumb */
.breadcrumb {
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Article Content */
.article-hero {
  width: 100%;
  height: 460px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.article-content {
  font-size: 1.05rem;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--color-text);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(15, 118, 110, 0.2);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--color-text);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.article-content h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-content h5,
.article-content h6 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--color-text);
}

.article-content p {
  margin-bottom: 1.25rem;
  color: var(--color-text);
  line-height: 1.85;
}

.article-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: var(--transition);
}

.article-content a:hover {
  color: var(--color-primary-dark);
  text-decoration-thickness: 2px;
}

.article-content strong {
  font-weight: 700;
  color: var(--color-text);
}

.article-content em {
  font-style: italic;
}

.article-content ul {
  margin: 1rem 0 1.25rem 1.5rem;
  list-style: none;
}

.article-content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
  color: var(--color-text);
}

.article-content ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: bold;
}

.article-content ol {
  margin: 1rem 0 1.25rem 1.5rem;
  list-style: none;
  counter-reset: ol-counter;
}

.article-content ol li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.6rem;
  color: var(--color-text);
  counter-increment: ol-counter;
}

.article-content ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Blockquote */
.article-content blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--color-primary);
  background: rgba(15, 118, 110, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  position: relative;
}

.article-content blockquote::before {
  content: '"';
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  font-size: 3rem;
  color: var(--color-primary);
  opacity: 0.3;
  font-family: Georgia, serif;
  line-height: 1;
}

.article-content blockquote p {
  margin-bottom: 0;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-text);
}

.article-content blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: normal;
}

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.article-content th {
  background: rgba(15, 118, 110, 0.1);
  color: var(--color-text);
  font-weight: 700;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--color-primary);
}

.article-content td {
  padding: 0.65rem 1rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.article-content tr:last-child td {
  border-bottom: none;
}

.article-content tr:nth-child(even) td {
  background: var(--color-bg-card);
}

/* Figures & images */
.article-content figure {
  margin: 2rem 0;
}

.article-content figure img,
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

.article-content figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Horizontal rule */
.article-content hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2.5rem 0;
}

/* Code blocks */
.article-content pre {
  background: var(--color-code-bg);
  color: #E2E8F0;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.7;
  border-left: 4px solid var(--color-primary);
}

.article-content code {
  font-family: 'Courier New', Courier, monospace;
}

.article-content p code,
.article-content li code {
  background: rgba(15, 118, 110, 0.1);
  color: var(--color-primary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Metric cards */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.metric-card {
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
}

.metric-card .metric-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.metric-card .metric-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

@media (max-width: 640px) {
  .metric-cards {
    grid-template-columns: 1fr;
  }
}

/* Sidebar */
.sidebar-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}

.sidebar-sticky {
  position: sticky;
  top: 88px;
}

/* Prev/Next navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

.post-nav-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-decoration: none;
  transition: var(--transition);
  display: block;
}

.post-nav-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-hover);
}

/* Comments */
.comment-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.comment-reply {
  margin-left: 2rem;
  margin-top: 0.75rem;
  border-left: 3px solid var(--color-primary);
  padding-left: 1rem;
}

/* Share buttons */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-text);
  text-decoration: none;
}

.share-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(15, 118, 110, 0.06);
  transform: translateY(-1px);
}

.share-btn svg {
  flex-shrink: 0;
}

/* Tags */
.tag-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: var(--transition);
  cursor: pointer;
}

.tag-badge:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success message */
.success-message {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #065F46;
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: none;
}

.dark .success-message {
  color: #6EE7B7;
}

.success-message.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ── Responsive Utilities ── */
@media (max-width: 768px) {
  .article-hero {
    height: 240px;
    border-radius: var(--radius-sm);
  }

  .post-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* ── Hero : boutons CTA empilés ── */
  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
    padding: 0 1.5rem;
  }

  .hero-cta-group .btn-primary,
  .hero-cta-group .btn-outline,
  .hero-cta-group .btn-ghost-hero {
    justify-content: center;
    width: 100%;
    text-align: center;
  }

  /* ── Hero : stats — masquer séparateurs, réduire l'espacement ── */
  .hero-stat-sep {
    display: none;
  }

  .hero-stats {
    gap: 1.25rem 1.75rem;
  }

  .hero-stat-number {
    font-size: 1.75rem;
  }

  /* ── Carrousel : masquer les boutons nav (swipe disponible) ── */
  .carousel-btn {
    display: none;
  }

  /* ── Post card footer : empiler date + bouton ── */
  .post-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .post-card-footer .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* ── WPForms — reset et thème custom ── */

/* Structure générale */
.wpforms-wrapper .wpforms-form {
  margin: 0;
}

.wpforms-wrapper .wpforms-field-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.wpforms-wrapper .wpforms-field {
  margin: 0 !important;
  padding: 0 !important;
}

/* Labels */
.wpforms-wrapper .wpforms-field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem !important;
  color: var(--color-text) !important;
  font-family: 'Inter', sans-serif;
}

.wpforms-wrapper .wpforms-required-label {
  color: #EF4444;
  margin-left: 0.15rem;
}

.wpforms-wrapper .wpforms-field-sublabel {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* Inputs, textarea, select */
.wpforms-wrapper input[type="text"],
.wpforms-wrapper input[type="email"],
.wpforms-wrapper input[type="tel"],
.wpforms-wrapper input[type="url"],
.wpforms-wrapper input[type="number"],
.wpforms-wrapper input[type="password"],
.wpforms-wrapper textarea,
.wpforms-wrapper select {
  width: 100% !important;
  padding: 0.75rem 1rem !important;
  background: var(--color-bg) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--color-text) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
  transition: var(--transition) !important;
  outline: none !important;
  box-shadow: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  height: auto !important;
  margin: 0 !important;
}

/* Select : flèche personnalisée */
.wpforms-wrapper select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 1rem center !important;
  padding-right: 2.5rem !important;
  cursor: pointer !important;
}

/* Focus */
.wpforms-wrapper input[type="text"]:focus,
.wpforms-wrapper input[type="email"]:focus,
.wpforms-wrapper input[type="tel"]:focus,
.wpforms-wrapper input[type="url"]:focus,
.wpforms-wrapper input[type="number"]:focus,
.wpforms-wrapper input[type="password"]:focus,
.wpforms-wrapper textarea:focus,
.wpforms-wrapper select:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1) !important;
}

/* Champs en erreur */
.wpforms-wrapper input.wpforms-error,
.wpforms-wrapper textarea.wpforms-error,
.wpforms-wrapper select.wpforms-error {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Messages d'erreur par champ */
.wpforms-wrapper label.wpforms-error {
  color: #EF4444 !important;
  font-size: 0.8rem !important;
  font-weight: 400 !important;
  margin-top: 0.25rem !important;
  display: block !important;
}

/* Ligne nom (first + last) */
.wpforms-wrapper .wpforms-field-row {
  display: flex;
  gap: 1rem;
}

.wpforms-wrapper .wpforms-field-row-block {
  flex: 1;
  min-width: 0;
}

/* Bouton submit */
.wpforms-wrapper .wpforms-submit-container {
  margin-top: 0.25rem;
  padding: 0 !important;
}

.wpforms-wrapper .wpforms-submit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  width: 100% !important;
  padding: 0.85rem 1.75rem !important;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
  box-shadow: 0 4px 15px rgba(15, 118, 110, 0.3) !important;
  letter-spacing: 0.01em !important;
  height: auto !important;
}

.wpforms-wrapper .wpforms-submit:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.4) !important;
}

.wpforms-wrapper .wpforms-submit:disabled,
.wpforms-wrapper .wpforms-submit[disabled] {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Message de confirmation / succès */
.wpforms-wrapper .wpforms-confirmation-container-full,
.wpforms-wrapper .wpforms-confirmation-scroll {
  background: rgba(16, 185, 129, 0.1) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  border-radius: var(--radius-sm) !important;
  padding: 1rem 1.25rem !important;
  color: #065F46 !important;
  font-size: 0.9rem !important;
  margin-top: 1rem !important;
}

.dark .wpforms-wrapper .wpforms-confirmation-container-full,
.dark .wpforms-wrapper .wpforms-confirmation-scroll {
  color: #6EE7B7 !important;
}

/* Masquer éléments parasites WPForms */
.wpforms-wrapper .wpforms-field-hp,
.wpforms-wrapper .wpforms-recaptcha-container~p,
.wpforms-wrapper noscript {
  display: none !important;
}

/* Dark mode : placeholder */
.dark .wpforms-wrapper input::placeholder,
.dark .wpforms-wrapper textarea::placeholder {
  color: var(--color-text-muted) !important;
  opacity: 0.7;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 3px;
}