/* ==========================================================================
   MÉDIAMATIQUE CPNV · PORTES OUVERTES 2026
   --------------------------------------------------------------------------
   Design system (référence inline)

   PALETTE
   -------
   Cyan         #56BFDC   accent principal
   Noir         #000000   texte, traits, fonds
   Blanc cassé  #F6FCFE   fond de page
   Blanc        #FFFFFF   surfaces

   DOMAINES (charte Chap. 5)
   -------
   Multimédia   #FAB200   Design      #DB6102
   Marketing    #A50B73   Admin       #791981
   Informatique #203D91   Méthodo     #00747E
   CG           #009334   CFC         #83B03A

   TYPOGRAPHIE
   -------
   Barlow · 100 / 300 / 600 / 700 / 800 / 900

   ESPACEMENT (échelle 4 / 8)
   -------
   4 · 8 · 12 · 16 · 24 · 32 · 48 · 64 · 96

   RAYON
   -------
   0 partout · style éditorial suisse

   MOUVEMENT
   -------
   ease-out-expo · 180 / 280 / 600 ms · courbe signature GSAP osmo
   Lenis smooth scroll · grain SVG · momentum hover · marquee
   ========================================================================== */

:root {
  --c-cyan: #56BFDC;
  --c-black: #000000;
  --c-offwhite: #F6FCFE;
  --c-white: #FFFFFF;
  --c-hairline: rgba(0, 0, 0, 0.18);

  --d-multimedia: #FAB200;
  --d-design: #DB6102;
  --d-marketing: #A50B73;
  --d-admin: #791981;
  --d-informatique: #203D91;
  --d-methodologie: #00747E;
  --d-cg: #009334;
  --d-cfc: #83B03A;

  --font-barlow: 'Barlow', sans-serif;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-osmo: cubic-bezier(0.625, 0.05, 0, 1);
  --dur-fast: 180ms;
  --dur-base: 280ms;
  --dur-slow: 600ms;

  --header-h: 112px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

/* Lenis prend le relais du scroll natif */
html.lenis { height: auto; }
html.lenis, html.lenis body { overscroll-behavior: none; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

body {
  font-family: var(--font-barlow);
  background-color: var(--c-offwhite);
  color: var(--c-black);
  line-height: 1.5;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;

  /* Aucune césure automatique, aucun mot coupé au milieu */
  hyphens: none;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}

::selection { background: var(--c-cyan); color: var(--c-black); }
:focus-visible { outline: 2px solid var(--c-black); outline-offset: 3px; }
img { display: block; max-width: 100%; }

section[id], footer[id] {
  scroll-margin-top: calc(var(--header-h) + var(--sp-3));
}

/* ==========================================================================
   GRAIN (SVG feTurbulence, aucune image à charger)
   ========================================================================== */
.grain-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  background-repeat: repeat;
}

/* ==========================================================================
   ASSEMBLAGE DE QI (dégradé à 8 arrêts durs, aucune ligne blanche possible)
   ========================================================================== */
.qi-assembly-bar {
  height: 8px;
  width: 100%;
  background: linear-gradient(
    to right,
    var(--d-multimedia)   0     12.5%,
    var(--d-design)       12.5% 25%,
    var(--d-marketing)    25%   37.5%,
    var(--d-admin)        37.5% 50%,
    var(--d-informatique) 50%   62.5%,
    var(--d-methodologie) 62.5% 75%,
    var(--d-cg)           75%   87.5%,
    var(--d-cfc)          87.5% 100%
  );
  transform-origin: top center;
  animation: qiDrop var(--dur-slow) var(--ease-out) both;
}

/* ==========================================================================
   EN-TÊTE (sticky en haut de page)
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 90;
  padding: var(--sp-6) 4vw var(--sp-5);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-6);
  border-bottom: 2px solid var(--c-black);
  background: var(--c-offwhite);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.logo-img { height: 56px; width: auto; }

.logo-text {
  font-size: 1.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  line-height: 0.95;
}

.logo-text span {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 2.5px;
  margin-top: var(--sp-1);
}

nav { display: flex; gap: var(--sp-7); }

nav a {
  position: relative;
  color: var(--c-black);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding-bottom: var(--sp-1);
}

nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--c-black);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-base) var(--ease-out);
}

nav a:hover::after,
nav a:focus-visible::after { transform: scaleX(1); }

nav a:focus-visible { outline-offset: 6px; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--sp-9) 4vw var(--sp-8);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--sp-8);
  align-items: end;
  /* pas d'overflow: hidden, sinon le symbole rotatif est clippé */
}

.hero-bg-symbol-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  opacity: 0.10;
  z-index: 0;
  pointer-events: none;
  transform-origin: center center;
  animation:
    spinSymbol 90s linear infinite,
    symbolFade 1.8s ease 0.2s both;
}

.hero-title-group { position: relative; z-index: 1; }

.hero-main-title {
  font-size: clamp(3.5rem, 8vw, 7.5rem);
  font-weight: 100;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: -2px;
}

.hero-main-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}

.hero-main-title .line-inner { display: block; }

.hero-main-title .char {
  display: inline-block;
  will-change: transform;
}

.hero-main-title strong { font-weight: 900; }
.hero-main-title .cyan-accent { color: var(--c-cyan); font-weight: 300; }

.hero-sidebar {
  position: relative;
  z-index: 1;
  border-left: 3px solid var(--c-black);
  padding-left: var(--sp-6);
  animation: revealUp var(--dur-slow) var(--ease-out) 0.40s both;
}

.hero-badge {
  display: inline-block;
  background: var(--c-black);
  color: var(--c-white);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 6px 12px;
  margin-bottom: var(--sp-4);
}

.hero-location {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #333;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--c-hairline);
}

.hero-description {
  font-size: 1.3rem;
  font-weight: 300;
  line-height: 1.5;
  color: #111;
  max-width: 42ch;
}

/* ==========================================================================
   SECTION THÈME + COMPTE À REBOURS (bloc unique centré)
   ========================================================================== */
.theme-unified-section {
  border-top: 2px solid var(--c-black);
  border-bottom: 2px solid var(--c-black);
  background: var(--c-white);
}

.theme-unified-container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--sp-8) 4vw;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-4);
}

.theme-section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.section-label {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--c-cyan);
  background: var(--c-black);
  padding: 6px 12px;
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  width: 100%;
  margin: var(--sp-2) 0 var(--sp-3);
}

.timer-box {
  border: 2px solid var(--c-black);
  background: var(--c-white);
  padding: var(--sp-5) var(--sp-2);
  text-align: center;
}

.timer-value {
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  font-weight: 200;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.timer-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: var(--sp-2);
}

.theme-info-text {
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.6;
  color: #222;
  max-width: 60ch;
}

/* Chaque mot reste insécable : la césure ne peut se faire qu'entre les mots */
.word {
  display: inline-block;
  white-space: nowrap;
}

/* Idem pour le titre hero, dont les lettres sont aussi splittées */
.hero-main-title .word {
  display: inline-block;
  white-space: nowrap;
}

/* Lettres mises en évidence au scroll */
[data-highlight-text] .char {
  display: inline-block;
  opacity: 0.18;
  will-change: opacity;
}

[data-highlight-text] .char.is-space { width: 0.28em; }

.confidential-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  border: 1px dashed var(--c-black);
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--c-white);
}

.confidential-badge svg { flex-shrink: 0; display: block; }

/* ==========================================================================
   SECTION DOMAINES
   ========================================================================== */
.domains-section {
  max-width: 1400px;
  margin: var(--sp-9) auto;
  padding: 0 4vw;
}

.domains-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-7);
  margin-bottom: var(--sp-7);
}

.domains-intro h2 {
  font-size: clamp(2.5rem, 4vw, 3.25rem);
  font-weight: 100;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -1px;
}

.domains-intro h2 strong { font-weight: 800; }

.domains-intro p {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.5;
  max-width: 42ch;
}

.domains-list { display: flex; flex-direction: column; }

.domain-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px 320px 1fr;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-6) var(--sp-5);
  border-top: 1px solid var(--c-hairline);
  transition: background-color var(--dur-base) var(--ease-out);
}

.domain-item:last-child { border-bottom: 1px solid var(--c-hairline); }

.domain-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent, var(--c-black));
  transform: scaleY(0);
  transform-origin: center center;
  transition: transform var(--dur-slow) var(--ease-out);
}

.domain-item:hover::before { transform: scaleY(1); }

.domain-item:hover { background: var(--c-white); }

@supports (background: color-mix(in srgb, red 5%, transparent)) {
  .domain-item:hover {
    background: color-mix(in srgb, var(--accent) 5%, transparent);
  }
}

.domain-num {
  font-size: 1.1rem;
  font-weight: 300;
  color: #777;
  transition: color var(--dur-base) var(--ease-out);
}

.domain-item:hover .domain-num { color: var(--accent, var(--c-black)); }

.domain-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.domain-logo-img {
  height: 38px;
  width: auto;
  flex-shrink: 0;
  will-change: transform;
}

.domain-name {
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.3px;
}

.domain-desc {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.5;
  color: #333;
  max-width: 68ch;
}

/* ==========================================================================
   PIED DE PAGE
   ========================================================================== */
footer {
  position: relative;
  background: var(--c-black);
  color: var(--c-white);
  padding: var(--sp-9) 4vw var(--sp-6);
  overflow: hidden;
}

.footer-content {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto var(--sp-7);
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--sp-6);
}

.footer-brand h3 {
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: var(--sp-4);
}

.footer-brand p {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.6;
  color: #A0A0A0;
  max-width: 52ch;
}

.footer-block h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--c-cyan);
  margin-bottom: var(--sp-4);
}

.footer-block p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  color: #DDD;
}

.footer-block a {
  color: #DDD;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.footer-block a:hover,
.footer-block a:focus-visible {
  color: var(--c-cyan);
  border-bottom-color: var(--c-cyan);
}

/* Réseaux sociaux */
.footer-socials {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto var(--sp-7);
  padding-top: var(--sp-6);
  border-top: 1px solid #2a2a2a;
}

.footer-socials h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--c-cyan);
  margin-bottom: var(--sp-4);
}

.socials-list {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.socials-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #333;
  color: #DDD;
  text-decoration: none;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.socials-list a:hover,
.socials-list a:focus-visible {
  color: var(--c-cyan);
  border-color: var(--c-cyan);
  transform: translateY(-3px);
}

.socials-list a:focus-visible { outline-offset: 3px; }

.socials-list svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* Marquee */
.footer-marquee {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  padding: var(--sp-5) 0;
  margin-bottom: var(--sp-6);
}

.footer-marquee__track {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  white-space: nowrap;
  width: max-content;
  animation: marqueeSlide 32s linear infinite;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--c-white);
}

.footer-marquee__track .dot {
  color: var(--c-cyan);
  font-weight: 300;
}

.footer-bottom {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding-top: var(--sp-5);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-5);
  font-size: 0.85rem;
  color: #888;
  font-weight: 400;
}

/* ==========================================================================
   ANIMATIONS CSS
   ========================================================================== */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes qiDrop {
  from { opacity: 0; transform: scaleY(0); }
  to   { opacity: 1; transform: scaleY(1); }
}

@keyframes spinSymbol {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes symbolFade {
  from { opacity: 0; }
  to   { opacity: 0.10; }
}

@keyframes marqueeSlide {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* Révélation au défilement (JS requis) */
.js .reveal { opacity: 0; }

.js .reveal.is-visible {
  animation: revealUp var(--dur-slow) var(--ease-out) both;
  animation-delay: var(--reveal-delay, 0ms);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 960px) {
  :root { --header-h: 152px; }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-5);
  }

  nav { gap: var(--sp-5); flex-wrap: wrap; }

  .hero {
    grid-template-columns: 1fr;
    gap: var(--sp-7);
    padding: var(--sp-8) 5vw var(--sp-7);
  }

  .hero-bg-symbol-img {
    width: 280px;
    height: 280px;
  }

  .domains-intro { flex-direction: column; align-items: flex-start; }

  .domain-item {
    grid-template-columns: 1fr;
    gap: var(--sp-3);
    padding: var(--sp-5) var(--sp-4);
  }
  .domain-num { display: none; }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
  .footer-bottom { flex-direction: column; gap: var(--sp-2); }

  .footer-socials { padding-top: var(--sp-5); }
  .socials-list { gap: var(--sp-3); }
  .socials-list a { width: 40px; height: 40px; }
}

@media (max-width: 520px) {
  .hero-main-title { letter-spacing: -1px; }
  .timer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   PRÉFÉRENCE : MOUVEMENT RÉDUIT
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal { opacity: 1 !important; }
  .hero-bg-symbol-img { animation: none !important; opacity: 0.10; }
  [data-highlight-text] .char { opacity: 1 !important; }
  .footer-marquee__track { animation: none !important; }
}