/* ==========================================================================
   NB Consulting — Introduction « Du chaos à la structure »
   Actif uniquement quand <html> porte la classe .intro-on (voir intro-gate.js).
   Ce fichier n'altère pas le site : il masque temporairement le hero
   pendant l'intro, puis le rend exactement à son état normal.
   ========================================================================== */

.intro,
.intro-edge {
  display: none;
}

html.intro-on {
  scrollbar-color: #2a2a2d #0a0a0b;
}

html.intro-on .intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  color: var(--on-dark);
  background:
    radial-gradient(110% 85% at 50% 46%, #151517 0%, #0b0b0c 58%, #060607 100%);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html.intro-on .intro-edge {
  display: block;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  z-index: 201;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
}

.intro__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Barres haute et basse, alignées sur la grille du site */
.intro__bar {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.intro__bar--top {
  top: 0;
  height: var(--header-h);
}

.intro__bar--bottom {
  bottom: 0;
  height: calc(var(--header-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}

.intro__corner,
.intro__hint,
.intro__skip {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}

.intro__corner b {
  font-weight: 500;
  color: var(--on-dark);
}

.intro__corner.is-in,
.intro__hint.is-in,
.intro__skip.is-in {
  opacity: 1;
}

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

.intro__hint::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.intro__hint.is-out {
  opacity: 0;
}

.intro__skip {
  position: relative;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--on-dark);
}

.intro__skip .arrow {
  transition: transform 0.5s var(--ease);
}

.intro__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  height: 1px;
  background: rgba(241, 239, 233, 0.16);
  overflow: hidden;
}

.intro__progress i {
  position: absolute;
  inset: 0;
  background: var(--on-dark);
  transform: scaleX(0);
  transform-origin: left;
}

@media (hover: hover) {
  .intro__skip:hover .arrow {
    transform: translateX(4px);
  }
}

.intro__skip:focus-visible {
  outline: 2px solid var(--accent-on-dark);
  outline-offset: 4px;
}

/* Titres centraux */
.intro__headline {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 50%;
  margin: 0;
  transform: translateY(-50%);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 6.6vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  pointer-events: none;
}

.intro__headline .l {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.intro__headline .l > span {
  display: inline-block;
  transform: translate3d(0, 105%, 0);
  transition: transform 0.85s var(--ease), opacity 0.5s ease;
}

.intro__headline .l:nth-child(2) > span {
  transition-delay: 0.08s;
}

.intro__headline.is-in .l > span {
  transform: none;
}

.intro__headline.is-out .l > span {
  transform: translate3d(0, -105%, 0);
  opacity: 0;
  transition-duration: 0.55s;
  transition-timing-function: cubic-bezier(0.55, 0, 0.75, 0);
}

.intro__headline .dim {
  color: #5c5b57;
}

.intro__headline .dot {
  color: var(--accent);
}

/* Copie du titre du hero : elle vole vers sa position finale */
.intro__title,
.intro__label {
  position: fixed;
  margin: 0;
  color: var(--on-dark);
  transform-origin: 50% 50%;
  pointer-events: none;
}

.intro__title {
  font-family: var(--font-display);
  font-weight: 500;
}

.intro__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.intro__title .line > span {
  display: inline-block;
  transform: translate3d(0, 105%, 0);
  transition: transform 0.75s var(--ease);
}

.intro__title .line:nth-child(2) > span {
  transition-delay: 0.09s;
}

.intro__title .line:nth-child(3) > span {
  transition-delay: 0.18s;
}

.intro__title.is-in .line > span {
  transform: none;
}

.intro__title .line--serif > span {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.intro__title .dot {
  color: var(--accent);
}

.intro__label {
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
}

.intro__label.is-in {
  opacity: 1;
}

/* --- Site pendant l'intro : hero masqué puis rendu à l'identique ------- */
html.js.intro-on .header {
  opacity: 0;
  pointer-events: none;
}

html.js.intro-on .hero [data-hero] {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
}

html.js.intro-on .hero .hero__label {
  transform: none;
}

html.js.intro-on .hero__title .line > span {
  transform: none;
  transition: none;
  visibility: hidden;
}

html.js.intro-on.intro-reveal .hero__title .line > span {
  visibility: visible;
}

html.js.intro-on.intro-reveal .hero .hero__label {
  opacity: 1;
  transition: none;
}

/* Mode « animations réduites » : intro statique et brève */
html.intro-reduced .intro__headline,
html.intro-reduced .intro__hint {
  display: none;
}
