/* =========================================================
   KolorLab — Design System
   ========================================================= */
@import url('./satoshi.css');

:root {
  --bg: #ffffff;
  --bg-soft: #f4f3f1;
  --bg-soft-2: #efeeec;
  --ink: #111111;
  --ink-soft: #8b8b8b;
  --ink-mute: #b6b6b4;
  --line: #e4e3e0;
  --line-soft: #ededeb;
  --black: #0a0a0a;
  --orange: #ff5c16;
  --orange-d: #f04e08;
  --pink: #ed1e79;
  --logo-grad: linear-gradient(96deg, #ff9a2e 0%, #ff6a2c 28%, #f04a8a 66%, #ed1e79 100%);
  --r: 14px;
  --maxw: 1600px;
  --pad: clamp(18px, 1.4vw, 20px);
  --font: 'Satoshi-Variable', 'Satoshi-Regular', system-ui, sans-serif;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none
}

img {
  max-width: 100%;
  display: block
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none
}

ul {
  list-style: none
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad)
}

.accent {
  color: var(--orange)
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 16px 30px;
  border-radius: 999px;
  transition: .25s ease;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.btn-orange {
  background: var(--orange);
  color: #fff
}

.btn-orange:hover {
  background: var(--orange-d)
}

.btn-dark {
  background: var(--black);
  color: #fff
}

.btn-dark:hover {
  background: #262626
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--ink)
}

.btn-ghost:hover {
  background: var(--ink);
  color: #fff
}

.btn-light {
  background: #fff;
  color: var(--ink);
  border-color: #fff
}

.btn-light:hover {
  background: #f0f0f0
}

.btn-sm {
  padding: 11px 20px;
  font-size: 12px
}

.link-u {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 3px;
  transition: .2s
}

.link-u:hover {
  color: var(--orange);
  border-color: var(--orange)
}

/* ---------- Header / Nav ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 86px;
  gap: 24px
}

.logo {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -.02em;
  color: var(--ink)
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  transition: .2s;
  white-space: nowrap;
}

.nav a:hover {
  border-color: var(--ink);
  z-index: 1
}

.nav a.active {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
  z-index: 2
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: transform .3s ease, opacity .2s ease
}
/* burger → croix quand le menu est ouvert */
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Footer ---------- */
.site-foot {
  background: var(--bg-soft);
  padding: 70px 0 36px;
  margin-top: 90px
}

.foot-top {
  display: flex;
  justify-content: flex-end;
  gap: 40px;
  flex-wrap: wrap
}

.foot-logo {
  margin-top: 30px;
}

.foot-logo img {
  display: block;
  width: 100%;
  max-width: 1015px;
  height: auto;
}

.foot-cols {
  display: flex;
  gap: 70px;
  flex-shrink: 0
}

.foot-col h4 {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin-bottom: 18px
}

.foot-col li {
  margin-bottom: 10px;
  font-size: 14px
}

.foot-col a {
  border-bottom: 1px solid transparent;
  transition: .2s
}

.foot-col a:hover {
  border-color: var(--ink)
}

.foot-col p {
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 6px
}

.foot-tag {
  margin-top: 48px;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.01em
}

.foot-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 60px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft)
}

.foot-bar .socials {
  display: flex;
  gap: 30px
}

.foot-bar .socials a {
  border-bottom: 1px solid transparent
}

.foot-bar .socials a:hover {
  border-color: var(--ink-soft)
}

/* ---------- Sections / Headings ---------- */
section {
  padding: 0
}

.section {
  padding-top: 90px
}

.h-display {
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: .98
}

.h1 {
  font-size: clamp(55px, 10vw, 138px);
  line-height: 115px;
  padding-bottom: 30px;
}

.h2 {
  font-size: clamp(30px, 4.6vw, 58px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.02
}

.h3 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -.02em
}

.eyebrow {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700
}

.lead {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.45
}

.muted {
  color: var(--ink-soft)
}

/* ---------- Palette swatch blocks ---------- */
.swatch {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  position: relative
}

/* Image révélée derrière la palette (mode « rideau ») */
.swatch-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.swatch span {
  flex: 1;
  display: block;
  position: relative;
  z-index: 1;
  transition: flex .4s cubic-bezier(.2, .7, .2, 1);
}

/* Accueil : la couleur est posée sur ::before (la couche « rideau ») tandis que
   le <span> reste fixe comme zone de survol — pas de scintillement à la levée */
:is(.grid-5, .nua-cards) .swatch span::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c);
  z-index: 0;
  transition: transform .55s cubic-bezier(.22, .8, .26, 1);
}

/* Cascade droite → gauche (bande la plus à droite en premier). Ces délais de
   BASE pilotent la FERMETURE ; ceux du mode reveal-on (plus spécifiques)
   pilotent l'OUVERTURE — même sens dans les deux cas. */
:is(.grid-5, .nua-cards) .swatch span:nth-of-type(5)::before { transition-delay: 0s; }
:is(.grid-5, .nua-cards) .swatch span:nth-of-type(4)::before { transition-delay: .07s; }
:is(.grid-5, .nua-cards) .swatch span:nth-of-type(3)::before { transition-delay: .14s; }
:is(.grid-5, .nua-cards) .swatch span:nth-of-type(2)::before { transition-delay: .21s; }
:is(.grid-5, .nua-cards) .swatch span:nth-of-type(1)::before { transition-delay: .28s; }

/* Œil activé : le rideau se lève, en cascade de la droite vers la gauche.
   Re-clic = se referme (même cascade, via les délais de base ci-dessus). */
.card.reveal-on .swatch>span::before {
  transform: translateY(-100%);
}
.card.reveal-on .swatch>span:nth-of-type(5)::before { transition-delay: 0s; }
.card.reveal-on .swatch>span:nth-of-type(4)::before { transition-delay: .07s; }
.card.reveal-on .swatch>span:nth-of-type(3)::before { transition-delay: .14s; }
.card.reveal-on .swatch>span:nth-of-type(2)::before { transition-delay: .21s; }
.card.reveal-on .swatch>span:nth-of-type(1)::before { transition-delay: .28s; }

/* Desktop hover : la bande s'écarte et révèle hex / rgb / cmjn */
@media (hover: hover) and (pointer: fine) {
  .swatch>span {
    cursor: pointer;
  }

  .swatch:hover>span {
    flex: .7;
  }

  .swatch>span:hover {
    flex: 3;
  }

  /* Mode « rideau » actif : on neutralise l'expansion au survol et le panneau
     hex (la levée est gérée au clic, cf. règle globale plus haut) */
  .card.reveal-on .swatch:hover>span {
    flex: 1;
  }

  .card.reveal-on .hex-info {
    opacity: 0 !important;
  }

  .hex-info {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 3px;
    text-align: left;
    font-style: normal;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .25s .15s ease, transform .25s .15s ease;
    pointer-events: none;
    padding: 0 12px 12px;
  }

  .swatch>span:hover .hex-info {
    opacity: 1;
    transform: none;
  }

  .hex-info b {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
  }

  /* Code hex cliquable = bouton de copie (grande cible) */
  .hex-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 1px;
    padding: 3px 7px 3px 3px;
    background: rgba(127, 127, 127, .14);
    border: 0;
    border-radius: 7px;
    color: inherit;
    font: inherit;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    /* .hex-info est en pointer-events:none */
    transition: background .15s ease;
  }

  .hex-copy:hover {
    background: rgba(127, 127, 127, .28);
  }

  .hex-copy:active {
    transform: translateY(1px);
  }

  .hex-copy svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: .75;
  }

  .hex-copy:hover svg {
    opacity: 1;
  }

  .hex-copy .ic-check {
    display: none;
  }

  .hex-copy.done .ic-copy {
    display: none;
  }

  .hex-copy.done .ic-check {
    display: inline;
    color: #2bd07a;
    opacity: 1;
  }

  .hex-info small {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .04em;
    opacity: .82;
    white-space: nowrap;
  }
}

/* ---------- Cards ---------- */
.card {
  display: flex;
  flex-direction: column
}

.card .swatch {
  aspect-ratio: 16/10;
  border-radius: 10px
}

.card-meta {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin: 16px 0 6px
}

.card h4 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em
}

.card p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 10px 0 16px;
  line-height: 1.5
}

/* Titre + œil « visualiser » */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
/* accueil : l'en-tête de carte ouvre la palette dans le configurateur */
.grid-5 .card-head { cursor: pointer; }
.grid-5 .card-head h4 { transition: color .2s ease; }
.grid-5 .card-head:hover h4 { color: var(--orange); }

.view-eye {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.view-eye:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.view-eye.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.view-eye svg {
  width: 17px;
  height: 17px;
}

/* ---------- Material rows ---------- */
.mat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line)
}

.mat-row span {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 500;
  letter-spacing: -.01em
}

.mat-row svg,
.mat-row img {
  height: 38px;
  width: auto;
  max-width: 56px;
  flex-shrink: 0
}

/* ---------- Pills / filters ---------- */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

.pill {
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  transition: .2s;
  color: var(--ink)
}

.pill:hover {
  border-color: var(--ink)
}

.pill.active {
  background: var(--black);
  color: #fff;
  border-color: var(--black)
}

/* ---------- Forms ---------- */
.field {
  margin-bottom: 22px
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 9px
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: .2s
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-mute)
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink)
}

.field textarea {
  resize: vertical;
  min-height: 120px
}

/* ---------- Utilities ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 22px
}

/* Carrousel infini pleine largeur (Nouveaux nuanciers) */
.grid-5.marquee {
  display: block;
  overflow: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
}

.marquee-track {
  display: flex;
  gap: 22px;
  width: max-content;
  will-change: transform;
  cursor: grab;
  user-select: none;
  perspective: 1400px;
  touch-action: pan-y; /* glissé horizontal géré en JS, scroll vertical natif conservé */
}

.marquee-track > .card {
  transform-origin: center center;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.grid-5.dragging .marquee-track {
  cursor: grabbing;
}

.marquee-track img {
  -webkit-user-drag: none;
  pointer-events: none;
}

.carousel-nav {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: .7s cubic-bezier(.2, .7, .2, 1)
}

.reveal.in {
  opacity: 1;
  transform: none
}

/* ---------- Responsive ---------- */
@media(max-width:980px) {
  /* le line-height fixe (115px) devient énorme quand la police rétrécit → on le rend proportionnel */
  .h1 { line-height: 1.02; padding-bottom: 0; }

  .nav {
    position: fixed;
    inset: 86px 0 auto 0;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 16px var(--pad);
    gap: 8px;
    transform: translateY(-130%);
    transition: .35s;
    }

  .nav.open {
    transform: none
  }

  .nav a {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    margin-left: 0;
    justify-content: flex-start
  }

  .nav-toggle {
    display: flex
  }

  .grid-3 {
    grid-template-columns: 1fr
  }

  .grid-5 {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 16px;
    margin: 0 calc(-1 * var(--pad));
    padding: 4px var(--pad) 24px;
    scroll-padding-left: var(--pad);
  }

  .grid-5::-webkit-scrollbar {
    display: none
  }

  .grid-5>.card {
    flex: 0 0 72%;
    scroll-snap-align: start;
  }

  .carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 22px;
  }

  .carousel-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: var(--ink);
    transition: .2s;
    padding: 0;
  }

  .carousel-arrow:hover {
    border-color: var(--ink);
  }

  .carousel-arrow:disabled {
    opacity: .3;
    cursor: default;
  }

  .carousel-dots {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .carousel-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--line);
    transition: .25s ease;
    cursor: pointer;
  }

  .carousel-dots span.on {
    background: var(--ink);
    width: 22px;
    border-radius: 4px;
  }

  .foot-cols {
    gap: 40px;
    width: 100%;
    justify-content: space-between
  }
}

@media(max-width:560px) {
  .grid-5>.card {
    flex: 0 0 78%;
  }
}
/* ---------- Transition rideau entre les pages ---------- */
.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  pointer-events: none;
  overflow: hidden; /* le chevauchement -1px des bandes est rogné proprement */
}

.page-curtain span {
  flex: 1;
  height: 100%;
  /* chevauchement d'1px pour éliminer les micro-espaces (arrondi sous-pixel du flex) */
  margin-right: -1px;
  transform: translateY(0); /* couvre l'écran par défaut (CSS bloquant → aucun flash) */
  will-change: transform;
}
.page-curtain span:last-child { margin-right: 0; }

/* Couleurs par défaut (écrasées par la palette aléatoire en JS) */
.page-curtain span:nth-child(1) { background: #2e4756; }
.page-curtain span:nth-child(2) { background: #3e6b73; }
.page-curtain span:nth-child(3) { background: #c96a4b; }
.page-curtain span:nth-child(4) { background: #a8a99a; }
.page-curtain span:nth-child(5) { background: #ece7dc; }

/* Transition + cascade droite → gauche (la bande la plus à droite bouge en 1er),
   utilisée à l'ouverture (.up) comme à la fermeture (retrait de .up) */
.page-curtain.anim span { transition: transform .35s cubic-bezier(.65, 0, .35, 1); }
.page-curtain.anim span:nth-child(5) { transition-delay: 0s; }
.page-curtain.anim span:nth-child(4) { transition-delay: .0375s; }
.page-curtain.anim span:nth-child(3) { transition-delay: .075s; }
.page-curtain.anim span:nth-child(2) { transition-delay: .1125s; }
.page-curtain.anim span:nth-child(1) { transition-delay: .15s; }

/* État levé : la page est révélée */
.page-curtain.up span { transform: translateY(-100%); }
