/* ==========================================================================
   vmnerds.fr — Design system "Datacenter Nocturne"
   ========================================================================== */

/* Reset anti-distorsion obligatoire */
img { max-width: 100%; height: auto; display: block; }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }

:root {
  /* Couleurs principales */
  --petrole: #0F3B4C;
  --petrole-dark: #0A2833;
  --ambre: #F2994A;
  --ambre-dark: #D97A2B;
  --phosphore: #4ADE80;
  --anthracite: #12181C;
  --anthracite-light: #1B2329;
  --blanc-casse: #FAFAF8;
  --gris-froid: #8B9AA3;
  --gris-texte: #3A4650;

  /* Dérivés opacité — pétrole */
  --petrole-80: rgba(15, 59, 76, 0.80);
  --petrole-65: rgba(15, 59, 76, 0.65);
  --petrole-40: rgba(15, 59, 76, 0.40);
  --petrole-20: rgba(15, 59, 76, 0.20);
  --petrole-10: rgba(15, 59, 76, 0.10);
  --petrole-06: rgba(15, 59, 76, 0.06);

  /* Dérivés opacité — anthracite */
  --anthracite-80: rgba(18, 24, 28, 0.80);
  --anthracite-65: rgba(18, 24, 28, 0.65);
  --anthracite-40: rgba(18, 24, 28, 0.40);
  --anthracite-20: rgba(18, 24, 28, 0.20);
  --anthracite-10: rgba(18, 24, 28, 0.10);
  --anthracite-06: rgba(18, 24, 28, 0.06);

  /* Dérivés opacité — blanc cassé */
  --blanc-95: rgba(250, 250, 248, 0.95);
  --blanc-75: rgba(250, 250, 248, 0.75);
  --blanc-40: rgba(250, 250, 248, 0.40);

  /* Bordures / ombres */
  --border: #E1E7E9;
  --border-warm: #D3DDE0;
  --shadow-sm: 0 1px 3px rgba(15, 59, 76, 0.10), 0 1px 2px rgba(15, 59, 76, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 59, 76, 0.14), 0 2px 6px rgba(15, 59, 76, 0.08);
  --shadow-lg: 0 10px 32px rgba(15, 59, 76, 0.18), 0 4px 16px rgba(15, 59, 76, 0.10);

  /* Polices */
  --ff-display: 'Space Grotesk', system-ui, sans-serif;
  --ff-body: 'Source Sans 3', system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Mesures */
  --measure-article: 840px;
  --measure-wide: 1280px;
  --measure-hero: 1440px;
  --gutter: clamp(1rem, 4vw, 2rem);

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 300ms;
  --dur: 500ms;
  --dur-slow: 700ms;

  /* Couleurs sémantiques */
  --bg: var(--blanc-casse);
  --bg-alt: #F1F4F5;
  --text: var(--gris-texte);
  --text-light: var(--gris-froid);
}

@font-face-fallback {}

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

body {
  font-family: var(--ff-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--ff-display);
  color: var(--petrole-dark);
  line-height: 1.2;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-top: 2.5rem; position: relative; padding-bottom: 0.5rem; }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

/* Filet décoratif animé sous H2 */
h2::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 48px; height: 3px;
  background: var(--ambre);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
h2.reveal.visible::after,
.article-body h2::after { transform: scaleX(1); }

a { color: var(--petrole); text-decoration-color: var(--petrole-40); }
a:hover { color: var(--ambre-dark); }

code, pre, kbd { font-family: var(--ff-mono); }
code { background: var(--petrole-06); color: var(--petrole-dark); padding: 0.15em 0.45em; border-radius: 4px; font-size: 0.92em; }
pre { background: var(--anthracite); color: var(--phosphore); padding: 1.2rem 1.4rem; border-radius: 10px; overflow-x: auto; font-size: 0.9rem; line-height: 1.6; }
pre code { background: none; color: inherit; padding: 0; }

/* Kickers */
.kicker {
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ambre-dark);
}

/* Container */
.container { max-width: var(--measure-wide); margin: 0 auto; padding: 0 var(--gutter); }
.container--article { max-width: var(--measure-article); margin: 0 auto; padding: 0 var(--gutter); }
.container--hero { max-width: var(--measure-hero); margin: 0 auto; padding: 0 var(--gutter); }

/* ==========================================================================
   Wrappers anti-distorsion images (aspect-ratio fixe, jamais object-fit seul)
   ========================================================================== */
.img-hero     { aspect-ratio: 3/2;  overflow: hidden; border-radius: 12px; }
.img-card     { aspect-ratio: 3/2;  overflow: hidden; border-radius: 10px; }
.img-body     { aspect-ratio: 3/2;  overflow: hidden; border-radius: 10px; }
.img-portrait { aspect-ratio: 1/1;  overflow: hidden; border-radius: 50%; }

.img-hero img, .img-card img, .img-body img, .img-portrait img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
}

.article-body img { max-width: 100%; height: auto; border-radius: 10px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--blanc-95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--dur-fast) var(--ease);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }
.site-header__inner {
  max-width: var(--measure-wide); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.site-header__logo {
  font-family: var(--ff-display); font-weight: 700; font-size: 1.35rem;
  color: var(--petrole-dark); display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none;
}
.site-header__logo .led-dot { display: inline-flex; gap: 3px; }
.site-header__logo .led-dot span { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.site-header__logo .led-dot span:nth-child(1) { background: var(--ambre); }
.site-header__logo .led-dot span:nth-child(2) { background: var(--phosphore); }
.site-header__logo .led-dot span:nth-child(3) { background: var(--petrole); }

.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav__link { font-weight: 600; font-size: 0.95rem; color: var(--gris-texte); text-decoration: none; }
.site-nav__link:hover { color: var(--petrole); }
.site-nav__dropdown { position: relative; }
.site-nav__dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 0.5rem;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 0.6rem; min-width: 240px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all var(--dur-fast) var(--ease);
}
.site-nav__dropdown:hover .site-nav__dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.site-nav__dropdown-menu a { display: block; padding: 0.5rem 0.7rem; border-radius: 6px; font-size: 0.9rem; text-decoration: none; color: var(--gris-texte); }
.site-nav__dropdown-menu a:hover { background: var(--petrole-06); color: var(--petrole); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--petrole-dark); margin: 5px 0; transition: all var(--dur-fast) var(--ease); }

@media (max-width: 880px) {
  .site-nav { position: fixed; top: 72px; left: 0; right: 0; bottom: 0;
    background: #fff; flex-direction: column; align-items: flex-start;
    padding: 2rem var(--gutter); gap: 1.2rem; overflow-y: auto;
    transform: translateX(100%); transition: transform var(--dur) var(--ease);
  }
  body.nav-open .site-nav { transform: translateX(0); }
  .site-nav__dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding-left: 1rem; display: none; }
  .site-nav__dropdown.open .site-nav__dropdown-menu { display: block; }
  .nav-toggle { display: block; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; color: #fff; overflow: hidden; }
.hero-home { min-height: 86vh; display: flex; align-items: center; }
.hero-compact { min-height: 46vh; display: flex; align-items: flex-end; padding-bottom: 3rem; }
.hero-home__img, .hero-compact__img {
  position: absolute; inset: 0; z-index: 0;
}
.hero-home__img img, .hero-compact__img img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
}
.hero-home__overlay, .hero-compact__overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, var(--anthracite-80) 0%, var(--petrole-65) 55%, var(--anthracite-80) 100%);
}
.hero__content { position: relative; z-index: 2; max-width: var(--measure-hero); margin: 0 auto; padding: 0 var(--gutter); }
.hero .kicker { color: var(--ambre); }
.hero h1 { color: #fff; margin: 0.6rem 0 1rem; }
.hero__description { font-size: 1.15rem; color: var(--blanc-75); max-width: 640px; margin-bottom: 1.6rem; }
.hero__cta { display: inline-flex; gap: 0.8rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.6rem; border-radius: 8px; font-weight: 600; font-size: 0.95rem;
  text-decoration: none; transition: all var(--dur-fast) var(--ease);
}
.btn--primary { background: var(--ambre); color: var(--anthracite); }
.btn--primary:hover { background: var(--ambre-dark); transform: translateY(-2px); }
.btn--outline { border: 1.5px solid var(--blanc-40); color: #fff; }
.btn--outline:hover { border-color: #fff; background: var(--blanc-40); }
.hero__scroll { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 2; color: var(--blanc-75); font-family: var(--ff-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }

.breadcrumb { font-size: 0.85rem; color: var(--blanc-75); margin-bottom: 0.8rem; }
.breadcrumb a { color: var(--blanc-75); text-decoration: none; }
.breadcrumb a:hover { color: #fff; }
.hero__meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--blanc-75); font-family: var(--ff-mono); margin-top: 0.8rem; }

/* ==========================================================================
   Article body
   ========================================================================== */
.article-summary {
  font-style: italic; font-size: 1.15rem; color: var(--petrole-dark);
  border-left: 3px solid var(--ambre); padding-left: 1.2rem; margin: 2rem 0;
}
.article-body { font-size: 1.08rem; }
.article-body > p:first-of-type::first-letter {
  font-family: var(--ff-display); font-size: 3.4rem; font-weight: 700;
  color: var(--ambre-dark); float: left; line-height: 0.85; margin: 0.05em 0.12em 0 0;
}
.article-body blockquote {
  border-left: 3px solid var(--phosphore); padding-left: 1.2rem; margin: 1.8rem 0;
  font-style: italic; color: var(--petrole-dark); font-size: 1.1rem;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-size: 0.95rem; }
.article-body th, .article-body td { padding: 0.7rem 1rem; border: 1px solid var(--border); text-align: left; }
.article-body th { background: var(--petrole-06); font-family: var(--ff-display); color: var(--petrole-dark); }
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-body li { margin-bottom: 0.4rem; }

.saviez-vous {
  background: var(--petrole-06); border: 1px solid var(--petrole-10); border-radius: 12px;
  padding: 1.4rem 1.6rem; margin: 2rem 0;
}
.saviez-vous strong { color: var(--petrole-dark); font-family: var(--ff-display); }

figure { margin: 1.8rem 0; }
figcaption {
  font-size: 0.85rem; color: var(--text-light); font-family: var(--ff-mono);
  margin-top: 0.6rem; text-align: center;
}

/* TOC sticky */
.toc { background: var(--bg-alt); border-radius: 12px; padding: 1.2rem 1.4rem; margin: 1.6rem 0; }
.toc summary { font-family: var(--ff-display); font-weight: 600; cursor: pointer; color: var(--petrole-dark); }
.toc ul { margin: 0.8rem 0 0; padding-left: 1.2rem; }
.toc a { text-decoration: none; font-size: 0.95rem; }
@media (min-width: 1100px) {
  .layout-with-toc { display: grid; grid-template-columns: 220px 1fr; gap: 3rem; align-items: start; }
  .layout-with-toc:not(:has(.toc-aside)) > article { grid-column: 1 / -1; }
  .toc.toc-sticky { position: sticky; top: 96px; max-height: calc(100vh - 110px); overflow-y: auto; }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.grid { display: grid; gap: 1.6rem; }
.grid--guides { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; }
.grid--blog { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .grid--guides, .grid--blog { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--guides, .grid--blog { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card__body { padding: 1.2rem 1.3rem 1.4rem; flex: 1; display: flex; flex-direction: column; }
.card__category { font-family: var(--ff-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ambre-dark); font-weight: 700; }
.card__title { font-family: var(--ff-display); font-size: 1.1rem; margin: 0.5rem 0; color: var(--petrole-dark); }
.card__date { font-size: 0.82rem; color: var(--text-light); font-family: var(--ff-mono); }
.card--feature { grid-column: span 2; grid-row: span 2; }
.card--feature .img-card { aspect-ratio: 16/9; }
@media (max-width: 620px) { .card--feature { grid-column: span 1; } }

.card__num {
  position: absolute; top: 0.8rem; right: 1rem; font-family: var(--ff-display);
  font-size: 2.4rem; font-weight: 700; color: var(--petrole-10); z-index: 1; line-height: 1;
}

/* ==========================================================================
   FAQ accordion
   ========================================================================== */
.faq { margin: 2.5rem 0; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item__question {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 0; cursor: pointer; font-family: var(--ff-display); font-weight: 600;
  color: var(--petrole-dark); font-size: 1.02rem;
}
.faq-item__toggle { font-size: 1.4rem; color: var(--ambre-dark); transition: transform var(--dur-fast) var(--ease); flex-shrink: 0; margin-left: 1rem; }
.faq-item.open .faq-item__toggle { transform: rotate(45deg); }
.faq-item__answer { max-height: 0; overflow: hidden; transition: max-height var(--dur) var(--ease); }
.faq-item.open .faq-item__answer { max-height: 800px; }
.faq-item__answer-inner { padding: 0 0 1.2rem; color: var(--text); line-height: 1.6; }

/* ==========================================================================
   Sections communes
   ========================================================================== */
section { padding: 4.5rem 0; }
.section--alt { background: var(--bg-alt); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 2.8rem; }
.section__head h2 { margin-top: 0; }
.section__head h2::after { left: 50%; transform: translateX(-50%) scaleX(1); }

.section--immersive { position: relative; color: #fff; padding: 6rem 0; overflow: hidden; }
.section--immersive .img-hero { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.section--immersive__overlay { position: absolute; inset: 0; background: linear-gradient(120deg, var(--anthracite-80), var(--petrole-65)); z-index: 1; }
.section--immersive__content { position: relative; z-index: 2; max-width: 680px; margin: 0 auto; text-align: center; padding: 0 var(--gutter); }
.section--immersive h2 { color: #fff; }
.section--immersive h2::after { background: var(--phosphore); }

.stat-counter { display: flex; justify-content: center; gap: 3.5rem; flex-wrap: wrap; text-align: center; }
.stat-counter__num { font-family: var(--ff-display); font-size: 2.6rem; font-weight: 700; color: var(--petrole-dark); }
.stat-counter__label { font-family: var(--ff-mono); font-size: 0.85rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.08em; }

.pull-quote { border-left: 3px solid var(--ambre); padding-left: 1.4rem; font-size: 1.25rem; font-style: italic; color: var(--petrole-dark); margin: 2.2rem 0; }

.related-grid { margin-top: 2.5rem; }
.article-nav-related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.article-nav-related h3 { font-size: 1.1rem; }
.article-nav-related__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 620px) { .article-nav-related__list { grid-template-columns: 1fr; } }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--anthracite); color: var(--blanc-75); padding: 4rem 0 2rem; }
.site-footer .container { max-width: var(--measure-wide); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: var(--phosphore); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem; }
.footer-grid a { display: block; color: var(--blanc-75); text-decoration: none; font-size: 0.92rem; margin-bottom: 0.55rem; }
.footer-grid a:hover { color: #fff; }
.footer-brand { font-family: var(--ff-display); font-weight: 700; font-size: 1.3rem; color: #fff; margin-bottom: 0.6rem; }
.footer-tagline { font-size: 0.9rem; color: var(--gris-froid); max-width: 320px; }
.footer-bottom { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--anthracite-light); font-size: 0.82rem; color: var(--gris-froid); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; }
.footer-bottom a { color: var(--gris-froid); }

/* ==========================================================================
   404
   ========================================================================== */
.error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4rem var(--gutter); }
.error-page__code { font-family: var(--ff-mono); font-size: 5rem; color: var(--ambre); font-weight: 700; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
