/* ═══════════════════════════════════════════════════════
   ARTICLE BASE STYLES — Cyberpunk DNA, fond apparent
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base: #0a0510;
  --bg-card: rgba(20, 12, 30, 0.55);
  --bg-card-strong: rgba(20, 12, 30, 0.85);
  --text: #f5edff;
  --text-mute: rgba(245, 237, 255, 0.78);
  --text-dim: rgba(245, 237, 255, 0.55);
  --accent: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-magenta: #ec4899;
  --border: rgba(168, 85, 247, 0.18);
  --border-strong: rgba(168, 85, 247, 0.35);
  --code-bg: rgba(26, 15, 36, 0.75);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ════ FOND ANIMÉ AU SCROLL (CSS natif 2026) ════
   Animation-timeline: scroll(root) — la position du scroll
   pilote directement la progression du fond. Pas de JS. */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(168, 85, 247, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse 70% 80% at 80% 30%, rgba(236, 72, 153, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 90% 50% at 50% 100%, rgba(6, 182, 212, 0.14) 0%, transparent 60%),
    linear-gradient(180deg, #0a0510 0%, #0d0618 50%, #0a0510 100%);
  background-size: 100% 100%;
  background-position: 50% 50%;
  animation: bg-drift linear both;
  animation-timeline: scroll(root);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.6;
  animation: grid-shift linear both;
  animation-timeline: scroll(root);
}

@keyframes bg-drift {
  0% {
    background-position: 0% 0%, 100% 30%, 50% 100%, 0% 0%;
    filter: hue-rotate(0deg) saturate(1);
  }
  50% {
    background-position: 30% 50%, 70% 50%, 30% 50%, 0% 50%;
    filter: hue-rotate(15deg) saturate(1.1);
  }
  100% {
    background-position: 100% 100%, 0% 70%, 70% 0%, 0% 100%;
    filter: hue-rotate(-10deg) saturate(0.95);
  }
}

@keyframes grid-shift {
  0%   { transform: translate(0, 0); opacity: 0.6; }
  50%  { transform: translate(30px, -20px); opacity: 0.4; }
  100% { transform: translate(-20px, 40px); opacity: 0.55; }
}

/* Fallback navigateurs sans scroll-timeline (Firefox <= 2026.05 etc.) */
@supports not (animation-timeline: scroll()) {
  body::before {
    animation: bg-drift-fallback 30s ease-in-out infinite alternate;
  }
  body::after {
    animation: grid-shift-fallback 40s ease-in-out infinite alternate;
  }
  @keyframes bg-drift-fallback {
    to {
      background-position: 50% 50%, 50% 50%, 50% 50%, 0% 50%;
      filter: hue-rotate(15deg);
    }
  }
  @keyframes grid-shift-fallback {
    to { transform: translate(20px, 20px); }
  }
}

/* Canvas conteneur conservé (utilisé par les articles existants).
   Sur les nouveaux articles le fond animé vient de body::before/::after. */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Contenu au-dessus du fond */
.layout, .article-hero, .article-body, .key-takeaways,
.header, .footer, .related-articles, .author-bio, .cta-inline {
  position: relative;
  z-index: 1;
}

/* Contenu au-dessus du canvas */
.layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ════ SCROLL PROGRESS BAR ════ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-cyan) 50%, var(--accent-magenta) 100%);
  z-index: 100;
  width: 0%;
  transition: width 0.1s;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}

/* ════ HEADER STICKY ════ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 20px 60px;
  background: rgba(10, 5, 16, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header__logo {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-style: italic;
  color: var(--text);
  text-decoration: none;
}
.header__logo em { font-style: italic; color: var(--accent); }
.header__nav { display: flex; gap: 32px; }
.header__nav a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-mute);
  text-decoration: none;
  transition: color 0.3s;
}
.header__nav a:hover { color: var(--accent); }

/* ════ ARTICLE HERO ════ */
.article-hero {
  padding: 100px 60px 60px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.article-hero__eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
}
.article-hero__title {
  font-family: 'Fraunces', serif;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  color: var(--text);
}
.article-hero__title em { font-style: italic; color: var(--accent); }
.article-hero__meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.article-hero__meta .sep { color: var(--accent); }

/* ════ KEY TAKEAWAYS ════ */
.key-takeaways {
  max-width: 800px;
  margin: 0 auto 80px;
  padding: 40px;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}
.key-takeaways__title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}
.key-takeaways ul { list-style: none; }
.key-takeaways li {
  padding: 12px 0 12px 32px;
  position: relative;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  border-bottom: 1px solid rgba(168, 85, 247, 0.1);
}
.key-takeaways li:last-child { border-bottom: none; }
.key-takeaways li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ════ ARTICLE BODY ════ */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.article-body p {
  font-size: 18px;
  line-height: 1.78;
  margin-bottom: 24px;
  color: var(--text);
  /* Backdrop-blur léger pour lisibilité sur fond animé */
  background: rgba(10, 5, 16, 0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding: 4px 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-radius: 4px;
}

.article-body p.lead {
  font-size: 20px;
  color: var(--text);
  line-height: 1.7;
}

.article-body h2 {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.15;
  margin: 80px 0 28px;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.article-body h3 {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  margin: 56px 0 20px;
  color: var(--text);
}

.article-body strong { color: var(--accent-magenta); font-weight: 600; }
.article-body em { font-style: italic; color: var(--accent-cyan); }
.article-body a {
  color: var(--accent-magenta);
  text-decoration: underline;
  text-decoration-color: rgba(236, 72, 153, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s;
}
.article-body a:hover {
  text-decoration-color: var(--accent-magenta);
}

.article-body ul, .article-body ol {
  margin: 24px 0;
  padding-left: 32px;
  background: rgba(10, 5, 16, 0.25);
  backdrop-filter: blur(2px);
  border-radius: 8px;
  padding: 20px 20px 20px 52px;
}
.article-body ul li, .article-body ol li {
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 12px;
  color: var(--text);
}
.article-body ul li::marker { color: var(--accent); }
.article-body ol li::marker { color: var(--accent-cyan); font-weight: 600; }

/* ════ PULL-QUOTE ════ */
.pull-quote {
  margin: 60px -20px;
  padding: 40px 36px;
  border-left: 4px solid var(--accent);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 0 14px 14px 0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}
.pull-quote__text {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 28px;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.pull-quote__text em { color: var(--accent); font-style: italic; }
.pull-quote__attr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

/* ════ PHOTOS ════ */
.article-photo {
  margin: 64px -60px;
  position: relative;
}
.article-photo img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.2);
}
.article-photo__caption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  margin-top: 18px;
}
.article-photo__caption a {
  color: var(--text-mute);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-dim);
}
.article-photo__caption a:hover { color: var(--accent-magenta); }

/* ════ CODE BLOCKS ════ */
.article-body pre, .article-body code {
  font-family: 'JetBrains Mono', monospace;
}
.article-body code {
  background: var(--code-bg);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}
.article-body pre {
  background: var(--code-bg);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow-x: auto;
  margin: 32px 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.1);
}
.article-body pre code {
  background: transparent;
  padding: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

/* ════ TABLEAU COMPARATIF ════ */
.article-body table {
  width: 100%;
  margin: 40px 0;
  border-collapse: collapse;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.article-body th {
  background: rgba(168, 85, 247, 0.18);
  padding: 16px;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--border-strong);
}
.article-body td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  color: var(--text);
}
.article-body td strong { color: var(--accent-cyan); }

/* ════ CTA INLINE ════ */
.cta-inline {
  margin: 80px -20px;
  padding: 48px 40px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.18) 0%, rgba(236, 72, 153, 0.1) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(168, 85, 247, 0.15);
}
.cta-inline::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
  pointer-events: none;
}
.cta-inline__title {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-style: italic;
  margin-bottom: 16px;
  color: var(--text);
  position: relative;
}
.cta-inline__sub {
  font-size: 16px;
  color: var(--text-mute);
  margin-bottom: 32px;
  position: relative;
}
.cta-inline__btn {
  display: inline-block;
  padding: 18px 40px;
  background: var(--accent);
  color: var(--bg-base);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.3s;
  position: relative;
  box-shadow: 0 10px 40px rgba(168, 85, 247, 0.4);
}
.cta-inline__btn:hover {
  background: var(--accent-magenta);
  box-shadow: 0 20px 50px rgba(236, 72, 153, 0.5);
  transform: translateY(-2px);
}

/* ════ AUTEUR BIO ════ */
.author-bio {
  max-width: 720px;
  margin: 80px auto;
  padding: 40px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  gap: 32px;
  align-items: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.author-bio__photo {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-magenta));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 36px;
  color: var(--bg-base);
  font-weight: 500;
  flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}
.author-bio__content h4 {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--text);
}
.author-bio__role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}
.author-bio__text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-mute);
}

/* ════ ARTICLES LIÉS ════ */
.related-articles {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 24px;
}
.related-articles__title {
  font-family: 'Fraunces', serif;
  font-size: 36px;
  font-style: italic;
  text-align: center;
  margin-bottom: 48px;
  color: var(--text);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.related-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: all 0.4s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(168, 85, 247, 0.18);
}
.related-card__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.related-card__title {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 12px;
  color: var(--text);
}
.related-card__excerpt {
  font-size: 13px;
  color: var(--text-mute);
  line-height: 1.5;
}

/* ════ FOOTER ════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 60px;
  background: rgba(10, 5, 16, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: center;
  margin-top: 80px;
  position: relative;
  z-index: 1;
}
.footer p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ════ RESPONSIVE ════ */
@media (max-width: 768px) {
  .header { padding: 16px 24px; }
  .header__nav { gap: 16px; }
  .header__nav a { font-size: 10px; letter-spacing: 0.15em; }
  .article-hero { padding: 60px 24px 40px; }
  .article-body { padding: 0 16px 60px; }
  .article-body h2 { font-size: 30px; margin: 56px 0 20px; }
  .article-body h3 { font-size: 22px; }
  .article-body p { font-size: 17px; }
  .key-takeaways { padding: 28px 24px; margin: 0 16px 60px; }
  .pull-quote { padding: 32px 24px; margin: 50px 0; }
  .pull-quote__text { font-size: 22px; }
  .article-photo { margin: 40px -16px; }
  .article-photo img { border-radius: 8px; }
  .cta-inline { padding: 32px 24px; margin: 60px 0; }
  .cta-inline__title { font-size: 24px; }
  .author-bio { flex-direction: column; padding: 28px 24px; text-align: center; gap: 20px; }
  .related-grid { grid-template-columns: 1fr; }
}
