/* =================================================================
   SENTINELLE NUMERIQUE — magazine d'enquete cybersecurite
   Design tokens + base + composants
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,700;9..144,900&family=Inter:wght@300;400;500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  /* === Couleurs (palette magazine d'enquete) === */
  --paper: #FAF7F2;        /* fond principal — papier journal chaleureux */
  --paper-95: rgba(250, 247, 242, 0.95);
  --paper-75: rgba(250, 247, 242, 0.75);
  --paper-40: rgba(250, 247, 242, 0.4);

  --ink: #1A1A1A;          /* encre profonde */
  --ink-80: rgba(26, 26, 26, 0.80);
  --ink-65: rgba(26, 26, 26, 0.65);
  --ink-40: rgba(26, 26, 26, 0.40);
  --ink-20: rgba(26, 26, 26, 0.20);
  --ink-10: rgba(26, 26, 26, 0.10);
  --ink-06: rgba(26, 26, 26, 0.06);

  --text: #1F2024;          /* corps de texte */
  --text-soft: #4A4A4F;
  --text-muted: #6E6E73;

  --copper: #C9A85C;        /* accent editorial cuivre */
  --copper-dark: #A88845;
  --copper-light: #E0C58A;
  --copper-20: rgba(201, 168, 92, 0.20);

  --alert: #A8343A;         /* rouge alerte cybersecurite */
  --alert-dark: #832226;
  --alert-soft: rgba(168, 52, 58, 0.10);

  --rule: #C8C2B8;          /* beton clair separateurs */
  --rule-soft: #E5E0D6;

  /* === Polices === */
  --ff-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ff-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-quote: 'Cormorant Garamond', Georgia, serif;

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

  /* === Transitions === */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 250ms;
  --dur: 450ms;
  --dur-slow: 700ms;

  /* === Tailles fluides === */
  --fs-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.85rem);
  --fs-sm: clamp(0.875rem, 0.83rem + 0.2vw, 0.95rem);
  --fs-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --fs-md: clamp(1.125rem, 1.05rem + 0.4vw, 1.3rem);
  --fs-lg: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  --fs-xl: clamp(2rem, 1.6rem + 1.6vw, 3rem);
  --fs-2xl: clamp(2.5rem, 2rem + 2.5vw, 4.5rem);
  --fs-3xl: clamp(3rem, 2.4rem + 3vw, 5.5rem);

  /* === Ombres === */
  --shadow-soft: 0 1px 3px rgba(26, 26, 26, 0.06), 0 4px 12px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 2px 8px rgba(26, 26, 26, 0.08), 0 12px 28px rgba(26, 26, 26, 0.06);
  --shadow-deep: 0 4px 16px rgba(26, 26, 26, 0.12), 0 24px 60px rgba(26, 26, 26, 0.10);
}

/* === Reset minimal === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text);
  background: var(--paper);
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h1 { font-size: var(--fs-3xl); font-weight: 600; }
h2 { font-size: var(--fs-xl); font-weight: 500; margin-bottom: 1.25rem; }
h3 { font-size: var(--fs-lg); font-weight: 500; margin-bottom: 0.875rem; }
h4 { font-size: var(--fs-md); font-weight: 600; }

p { margin-bottom: 1.25em; }

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

.container-article {
  max-width: var(--measure-article);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-hero {
  max-width: var(--measure-hero);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* === Kicker (uppercase tracking large) === */
.kicker {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--copper-dark);
  margin-bottom: 1rem;
}

.kicker--alert { color: var(--alert); }
.kicker--ink { color: var(--ink-80); }

/* === Filets decoratifs sous H2 === */
.h2-rule {
  position: relative;
  padding-bottom: 0.625rem;
  display: inline-block;
}

.h2-rule::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 3rem;
  height: 2px;
  background: var(--copper);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}

.reveal.visible .h2-rule::after { transform: scaleX(1); }
.reveal:not(.visible) .h2-rule::after { transform: scaleX(0); }

/* === Lettrine premier paragraphe article === */
.article-body > p:first-of-type::first-letter {
  font-family: var(--ff-display);
  font-size: 4.5em;
  font-weight: 600;
  float: left;
  line-height: 0.85;
  margin-right: 0.625rem;
  margin-top: 0.125rem;
  color: var(--copper-dark);
}

/* === Pull quote === */
.pull-quote {
  border-left: 3px solid var(--alert);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--ff-quote);
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--ink-80);
  line-height: 1.45;
}

.pull-quote cite {
  display: block;
  margin-top: 0.625rem;
  font-family: var(--ff-body);
  font-size: var(--fs-sm);
  font-style: normal;
  color: var(--text-muted);
}

/* === Article summary (chapeau italique) === */
.article-summary {
  font-family: var(--ff-quote);
  font-size: var(--fs-md);
  font-style: italic;
  line-height: 1.55;
  color: var(--ink-80);
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

/* === TOC (sticky desktop) === */
.toc {
  background: var(--ink-06);
  border-left: 3px solid var(--copper);
  padding: 1.5rem 1.75rem;
  font-size: var(--fs-sm);
  margin: 2rem 0;
}

.toc-title {
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-65);
  margin-bottom: 0.875rem;
}

.toc ol { list-style: none; counter-reset: toc; }
.toc li {
  counter-increment: toc;
  padding: 0.375rem 0;
  border-bottom: 1px dotted var(--rule);
}
.toc li:last-child { border-bottom: none; }
.toc li::before {
  content: counter(toc, upper-roman) '.';
  font-family: var(--ff-quote);
  font-style: italic;
  color: var(--copper-dark);
  margin-right: 0.625rem;
  display: inline-block;
  min-width: 2rem;
}
.toc a {
  color: var(--ink-80);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease);
}
.toc a:hover { border-bottom-color: var(--copper); }

@media (min-width: 1100px) {
  .toc.toc-sticky {
    position: sticky;
    top: 6rem;
    align-self: start;
  }
}

/* === Article body === */
.article-body {
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--text);
}

.article-body h2 {
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}

.article-body h3 {
  margin-top: 2.25rem;
  margin-bottom: 0.875rem;
}

.article-body p { margin-bottom: 1.4em; }

.article-body a {
  color: var(--ink);
  border-bottom: 1px solid var(--copper);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.article-body a:hover {
  color: var(--alert);
  border-bottom-color: var(--alert);
}

.article-body ul, .article-body ol {
  margin: 0 0 1.5em 1.25em;
  padding-left: 0.5rem;
}
.article-body li { margin-bottom: 0.5em; }

.article-body img {
  border-radius: 2px;
  box-shadow: var(--shadow-soft);
  margin: 2rem auto;
}

.article-body blockquote {
  border-left: 3px solid var(--copper);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--ff-quote);
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--ink-80);
}

/* === Hero === */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  isolation: isolate;
}

.hero--home { min-height: 88vh; }

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) saturate(0.85);
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(26, 26, 26, 0.2) 0%, rgba(26, 26, 26, 0.65) 100%),
    radial-gradient(ellipse at top, transparent 30%, rgba(26, 26, 26, 0.4) 100%);
  pointer-events: none;
}

/* Grain texture (effet papier journal) */
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.92 0 0 0 0 0.85 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.4;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hero-content {
  width: 100%;
  padding: 3rem 0 5rem;
}

.hero-title {
  font-family: var(--ff-display);
  font-size: var(--fs-3xl);
  font-weight: 600;
  line-height: 1.05;
  color: var(--paper);
  max-width: 18ch;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-family: var(--ff-quote);
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--paper-75);
  max-width: 50ch;
  margin-bottom: 1.75rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-size: var(--fs-xs);
  color: var(--paper-75);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  align-items: center;
  font-weight: 500;
}

.hero-meta > * { display: inline-flex; align-items: center; }
.hero-meta > * + *::before {
  content: '·';
  margin-right: 1.5rem;
  color: var(--copper);
}

.hero-scroll {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--paper-75);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: scrollPulse 2.5s var(--ease) infinite;
}

.hero-scroll::after {
  content: '';
  width: 1px;
  height: 1.75rem;
  background: var(--copper);
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, 0); }
  50% { opacity: 1; transform: translate(-50%, 0.25rem); }
}

/* === Cards === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: transparent;
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur) var(--ease);
}

.card:hover { transform: translateY(-4px); }

.card-image {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--ink-10);
  margin-bottom: 1.25rem;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.card:hover .card-image img { transform: scale(1.05); }

.card-kicker {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--copper-dark);
  margin-bottom: 0.5rem;
}

.card-title {
  font-family: var(--ff-display);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.card-lede {
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text-soft);
  margin-bottom: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: auto;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.card-meta > * + *::before { content: ' · '; color: var(--copper); margin: 0 0.375rem; }

/* === Boutons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.75rem;
  font-family: var(--ff-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid currentColor;
  transition: all var(--dur-fast) var(--ease);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--copper-dark);
  border-color: var(--copper-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.btn-link {
  border: none;
  border-bottom: 1px solid var(--copper);
  padding: 0.25rem 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink);
}
.btn-link:hover { color: var(--alert); border-bottom-color: var(--alert); }

/* === Sections === */
.section {
  padding: clamp(3.5rem, 7vw, 7rem) 0;
}

.section--ink {
  background: var(--ink);
  color: var(--paper);
}
.section--ink h2, .section--ink h3 { color: var(--paper); }
.section--ink .kicker { color: var(--copper-light); }
.section--ink p { color: var(--paper-75); }

.section-intro {
  max-width: 38rem;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-title {
  font-size: var(--fs-2xl);
  margin-bottom: 1rem;
}

.section-lede {
  font-family: var(--ff-quote);
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--text-soft);
  max-width: 38ch;
  margin: 0 auto;
}

/* === FAQ accordion === */
.faq {
  margin: 3rem 0;
}

.faq-item {
  border-bottom: 1px solid var(--rule);
}

.faq-question {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
  font-family: var(--ff-display);
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.faq-toggle {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-quote);
  font-size: 1.5rem;
  color: var(--copper-dark);
  transition: transform var(--dur) var(--ease);
}

.faq-item.open .faq-toggle { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur) var(--ease);
}

.faq-item.open .faq-answer { max-height: 1000px; }

.faq-answer-inner {
  padding: 0 0 1.5rem 0;
  color: var(--text-soft);
  line-height: 1.7;
}

/* === Header === */
.site-header {
  position: sticky;
  top: 0; z-index: 50;
  background: var(--paper-95);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.site-header.scrolled {
  border-bottom-color: var(--rule);
  box-shadow: var(--shadow-soft);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.125rem 0;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 1.5rem; height: 1.5rem;
  background: var(--copper);
  border-radius: 50%;
  position: relative;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 2px solid var(--paper);
  border-radius: 50%;
}

.brand-name { line-height: 1; }
.brand-tag {
  font-family: var(--ff-quote);
  font-style: italic;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.nav { display: flex; gap: 2rem; align-items: center; }
.nav a {
  font-size: var(--fs-sm);
  color: var(--ink-80);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--dur-fast);
  position: relative;
}
.nav a:hover { color: var(--copper-dark); }
.nav a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -0.5rem;
  height: 1px; background: var(--copper);
}

.nav-toggle {
  display: none;
  width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--ink-20);
  border-radius: 2px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-toggle span {
  width: 1.25rem; height: 1.5px;
  background: var(--ink);
  transition: transform var(--dur-fast);
}

@media (max-width: 800px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  body.nav-open .nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--paper);
    padding: 1.5rem var(--gutter) 2rem;
    border-bottom: 1px solid var(--rule);
    gap: 1.5rem;
    align-items: flex-start;
  }
}

/* === Footer === */
.site-footer {
  background: var(--ink);
  color: var(--paper-75);
  padding: 4.5rem 0 2rem;
  font-size: var(--fs-sm);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer-col h4 {
  font-family: var(--ff-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--copper-light);
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.625rem; }
.footer-col a { color: var(--paper-75); transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--copper-light); }

.footer-brand {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--paper);
  margin-bottom: 0.5rem;
}

.footer-tag {
  font-family: var(--ff-quote);
  font-style: italic;
  color: var(--paper-40);
  margin-bottom: 1.25rem;
}

.footer-bottom {
  border-top: 1px solid rgba(250, 247, 242, 0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: var(--fs-xs);
  color: var(--paper-40);
  letter-spacing: 0.04em;
}

.footer-bottom a { color: var(--paper-75); }
.footer-bottom a:hover { color: var(--copper-light); }

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

/* === Utils === */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

.text-center { text-align: center; }

.divider {
  height: 1px;
  background: var(--rule);
  margin: 3rem 0;
}

.divider-ornament {
  display: flex; align-items: center; gap: 1rem;
  margin: 3rem 0;
  color: var(--copper);
}
.divider-ornament::before, .divider-ornament::after {
  content: ''; flex: 1; height: 1px; background: var(--rule);
}
.divider-ornament-mark {
  font-family: var(--ff-quote);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--copper-dark);
}
