/* Insermedia — design tokens & resets */
:root {
  --c-red: #e3312d;
  --c-orange: #f18f34;
  --c-pink: #e896c0;
  --c-purple: #b592c3;
  --c-blue: #618dc9;
  --c-blue-deep: #3a5db0;
  --ink: #1a1428;
  --ink-2: #3d3349;
  --ink-3: #6b6378;
  --cream: #fdfaf4;
  --cream-2: #f3ede1;
  --line: rgba(26, 20, 40, 0.10);
  --rainbow: linear-gradient(110deg, #e3312d 0%, #e95f32 12%, #f18f34 28%, #e896c0 50%, #b592c3 70%, #788ec7 86%, #618dc9 100%);
  --rainbow-soft: linear-gradient(110deg, #e3312d 0%, #f18f34 25%, #e896c0 50%, #b592c3 72%, #618dc9 100%);
}

html, body { overflow-x: clip; }

.screen, .screen * { box-sizing: border-box; }
.screen {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
.screen h1, .screen h2, .screen h3, .screen h4, .display {
  font-family: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
}
.screen p { text-wrap: pretty; margin: 0; }

/* Logo */
.logomark { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }

/* Halftone dot pattern — apply as background or mask */
.halftone {
  background-image: radial-gradient(circle, currentColor 1.4px, transparent 1.8px);
  background-size: 14px 14px;
  background-position: 0 0;
}
.halftone-dense { background-size: 10px 10px; }
.halftone-loose { background-size: 22px 22px; }

/* Halftone-masked gradient: dots filled with the rainbow */
.halftone-rainbow {
  background: var(--rainbow);
  -webkit-mask-image: radial-gradient(circle, #000 1.4px, transparent 1.8px);
          mask-image: radial-gradient(circle, #000 1.4px, transparent 1.8px);
  -webkit-mask-size: 14px 14px;
          mask-size: 14px 14px;
}

/* Floating drift — ambient motion suggesting parallax depth */
@keyframes drift-a { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(-26px, -18px, 0); } }
@keyframes drift-b { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(20px, -28px, 0); } }
@keyframes drift-c { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(-14px, 24px, 0); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes pulse-soft { 0%,100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.parallax-a { animation: drift-a 22s ease-in-out infinite; }
.parallax-b { animation: drift-b 28s ease-in-out infinite; }
.parallax-c { animation: drift-c 34s ease-in-out infinite; }
.parallax-spin { animation: spin-slow 180s linear infinite; }

/* Giant sphere watermark — clipped to show only the dot-sphere portion of the logo (top ~75%) */
.logo-sphere-bg {
  background: url('assets/logo_insermedia.png') no-repeat center top;
  background-size: contain;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 78%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 78%);
}

/* Nav */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 56px;
  background: #ffffff;
  position: relative;
  overflow: visible;
  z-index: 5;
}
.nav-sticky {
  position: sticky;
  top: 0;
}
.nav-logo-slot {
  position: absolute; left: 56px; top: 6px; z-index: 6;
  pointer-events: auto;
}
.nav-logo-spacer { width: 120px; flex-shrink: 0; }
.nav-logo-spacer-lg { width: 200px; flex-shrink: 0; }
.nav-links { display: flex; gap: 34px; }
.nav-links a { text-decoration: none; color: var(--ink); }
/* Niv. 1 uniquement (direct child a, ou a dans le wrapper div direct) */
.nav-links > a,
.nav-links > div > a {
  font-size: 11.5px; font-weight: 300;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 6px 0; position: relative;
}
.nav-links > a.active::after,
.nav-links > div > a.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--rainbow); border-radius: 2px;
}
.nav-utility { display: flex; align-items: center; gap: 20px; }
.lang { display: flex; gap: 2px; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--ink-3); }
.lang b { color: var(--ink); }
.btn { 
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer; transition: transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: var(--cream); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-rainbow { background: var(--rainbow); color: white; }
.btn-cream { background: var(--cream); color: var(--ink); }
.btn-lg { padding: 14px 26px; font-size: 14px; }

/* Section helpers */
.section { padding: 80px 56px; }
.eyebrow { 
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
  color: var(--ink-2);
}
.eyebrow::before { content: ''; width: 24px; height: 1.5px; background: var(--ink-2); }
.eyebrow-light { color: rgba(253,250,244,.65); }
.eyebrow-light::before { background: rgba(253,250,244,.65); }

/* Footer */
.footer { background: var(--ink); color: var(--cream); padding: 64px 56px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 0.6fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.12);}
.footer h5 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .55; margin: 0 0 16px; font-family: 'Inter'; font-weight: 600;}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: var(--cream); text-decoration: none; opacity: .8; font-size: 13.5px; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 24px; font-size: 12px; opacity: .55; }

/* Shared color chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); background: white; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .nav { padding: 14px 32px; }
  .nav-logo-slot { left: 32px; }
  .nav-links { gap: 20px; }
  .nav-links > a, .nav-links > div > a { font-size: 10.5px; letter-spacing: 0.15em; }
  .nav-utility { gap: 12px; }
  .nav-search input { width: 120px; }
  .section { padding: 60px 32px; }
  .footer { padding: 48px 32px 24px; }
  .footer-grid { gap: 28px; }
}
@media (max-width: 768px) {
  .nav { padding: 12px 20px; }
  .nav-logo-slot { left: 20px; top: 50%; transform: translateY(-50%); }
  .nav-logo-slot img { height: 46px !important; width: auto !important; }
  .nav-logo-spacer, .nav-logo-spacer-lg { width: 120px; flex-shrink: 0; }
  .nav-links { display: none; }
  .nav-search { display: none !important; }
  .nav-utility { display: none; }
  .nav-hamburger { display: flex !important; margin-left: auto; }
  .section { padding: 52px 20px; }
  .footer { padding: 40px 20px 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 10px; }
  .btn-lg { padding: 12px 20px; font-size: 13px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}


/* ── Tooltips custom ─────────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: var(--ink);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(26,20,40,.28);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
}
[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  border: 5px solid transparent;
  border-top-color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 9999;
}
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Variante vers le bas — attribut explicite ou éléments dans la nav */
[data-tooltip-bottom]::after,
.nav [data-tooltip]::after {
  bottom: auto; top: calc(100% + 9px);
  transform: translateX(-50%) translateY(-5px);
}
[data-tooltip-bottom]::before,
.nav [data-tooltip]::before {
  bottom: auto; top: calc(100% + 3px);
  transform: translateX(-50%) translateY(-5px);
  border-top-color: transparent; border-bottom-color: var(--ink);
}
[data-tooltip-bottom]:hover::after,
[data-tooltip-bottom]:hover::before,
.nav [data-tooltip]:hover::after,
.nav [data-tooltip]:hover::before {
  transform: translateX(-50%) translateY(0);
}
/* Éléments côté droit de la nav : aligner à droite */
.nav-utility [data-tooltip]::after {
  left: auto; right: 0;
  transform: translateY(-5px);
}
.nav-utility [data-tooltip]::before {
  left: auto; right: 14px;
  transform: translateY(-5px);
}
.nav-utility [data-tooltip]:hover::after,
.nav-utility [data-tooltip]:hover::before {
  transform: translateY(0);
}
/* Éléments côté gauche de la nav (logo) : aligner à gauche */
.nav-logo-slot [data-tooltip]::after {
  left: 0; right: auto;
  transform: translateY(-5px);
}
.nav-logo-slot [data-tooltip]::before {
  left: 14px; right: auto;
  transform: translateY(-5px);
}
.nav-logo-slot [data-tooltip]:hover::after,
.nav-logo-slot [data-tooltip]:hover::before {
  transform: translateY(0);
}

/* ── Contenu riche (articles, actualités) ────────────────────────────────── */
.rich-content { font-size: 16px; line-height: 1.7; color: var(--ink-2); }
.rich-content p { margin: 0 0 1.1em; }
.rich-content h2 { font-size: 1.45em; font-weight: 700; margin: 1.6em 0 .55em; color: var(--ink); }
.rich-content h3 { font-size: 1.2em; font-weight: 700; margin: 1.4em 0 .45em; color: var(--ink); }
.rich-content ul,
.rich-content ol  { margin: 0 0 1.1em; padding-left: 1.5em; }
.rich-content li  { margin-bottom: .4em; }
.rich-content blockquote { border-left: 3px solid var(--c-orange); margin: 1.4em 0; padding: .6em 1em; background: var(--cream); border-radius: 0 8px 8px 0; font-style: italic; }
.rich-content a   { color: var(--c-blue); text-underline-offset: 3px; }
.rich-content strong { color: var(--ink); }
.rich-content img { max-width: 100%; border-radius: 10px; margin: .5em 0; }

/* ── RichTitle span classes ──────────────────────────────────────────────── */
.gradient {
  background: var(--rainbow);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline;
}
.highlight {
  color: var(--c-orange);
}

/* ── Back to top ─────────────────────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s, background .15s;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { background: var(--c-orange); transform: translateY(-3px); }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
