/* =========================================================
   NORBEX — MAIN STYLES
   Reset, base, navigation chrome, slider container
   ========================================================= */

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

/* ---------------------------------------------------------
   RESET
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--dur-slower) var(--ease-cinematic),
              color var(--dur-slower) var(--ease-cinematic);
}
img, svg, video { display: block; max-width: 100%; }
/* Protection photos (minimale) : pas de glisser ni de sélection sur les images. */
img {
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }

/* ---------------------------------------------------------
   SLIDER SHELL
   --------------------------------------------------------- */
.slider {
  height: 100vh;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  /* Pas de scroll-behavior:smooth ici : combiné au snap "mandatory" il rend
     le défilement tactile collant/saccadé sur mobile (le navigateur ré-anime
     les flicks). Les scrolls programmés (boutons, clavier) passent par
     scrollIntoView({behavior:'smooth'}) dans slider.js. */
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.slider::-webkit-scrollbar { display: none; }

.slide-frame {
  height: 100vh;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  position: relative;
  overflow: hidden;
}

/* Tactile : ne pas peindre les slides hors écran (grain en mix-blend-mode,
   animations infinies, backdrop-filter × 7 slides saturent le GPU mobile).
   La hauteur des frames est fixe, donc aucun décalage de layout possible. */
@media (hover: none) and (pointer: coarse) {
  .slide-frame { content-visibility: auto; }
}

/* ---------------------------------------------------------
   NAVIGATION CHROME (top pill + side controls)
   --------------------------------------------------------- */
.chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: var(--space-5) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  mix-blend-mode: difference;
}
.chrome > * { pointer-events: auto; }

/* Brand mark (top-left) */
.chrome__brand {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--NORBEX-white);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.chrome__brand::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--fl-gold);
  box-shadow: 0 0 0 0 var(--fl-gold);
  animation: pulse 2.6s var(--ease-cinematic) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(200,169,106,0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(200,169,106,0); }
  100% { box-shadow: 0 0 0 0 rgba(200,169,106,0); }
}

/* Navigation pill (top-right) */
.chrome__nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 var(--space-5);
  background: var(--NORBEX-white);
  color: var(--NORBEX-black);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform var(--dur-fast) var(--ease-out-expo),
              background-color var(--dur-fast) var(--ease-out-expo),
              color var(--dur-fast) var(--ease-out-expo);
  mix-blend-mode: normal;
}
.pill:hover {
  transform: translateY(-2px);
  background: var(--NORBEX-black);
  color: var(--NORBEX-white);
}
.pill--icon {
  width: 44px;
  padding: 0;
}
.pill--icon svg { width: 16px; height: 16px; }

/* Slide navigation — compact dark pill in the bottom-right corner so it
   never bisects the slide content vertically the way a right-center
   stack would. Subtle by default, sharper on hover. */
.controls {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(11,10,8,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-pill);
  opacity: 0.78;
  transition: opacity var(--dur-base) var(--ease-cinematic);
}
.controls:hover { opacity: 1; }
.controls__btn {
  width: 34px; height: 34px;
  background: transparent;
  color: var(--NORBEX-white);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease-out-expo),
              border-color var(--dur-fast) var(--ease-out-expo),
              transform var(--dur-fast) var(--ease-out-expo);
}
.controls__btn:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}
.controls__btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  transform: none !important;
}
.controls__btn svg { width: 13px; height: 13px; }
.controls__count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--NORBEX-white);
  margin: 0 6px;
  text-align: center;
  line-height: 1;
  opacity: 0.82;
}

/* Slide indicator dots (left edge) */
.indicator {
  position: fixed;
  left: var(--space-6);
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  mix-blend-mode: difference;
}
.indicator__dot {
  width: 22px;
  height: 1px;
  background: var(--fl-white);
  opacity: 0.35;
  border-radius: 0;
  transition: opacity var(--dur-base) var(--ease-cinematic),
              width var(--dur-base) var(--ease-cinematic);
  cursor: pointer;
  display: block;
}
.indicator__dot.is-active {
  opacity: 1;
  width: 56px;
}

/* Loading state */
.slide-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.slide-loading::after {
  content: '';
  width: 32px; height: 32px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0.4;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 768px) {
  .chrome { padding: var(--space-4); }
  .indicator { display: none; left: var(--space-4); gap: var(--space-2); }
  .pill { height: 38px; padding: 0 var(--space-4); }
  .pill--icon { width: 38px; }
  .chrome__nav { gap: var(--space-1); }
  .chrome__brand { font-size: var(--fs-micro); }

  /* Slider pill: same shape as desktop, just a touch tighter for thumbs */
  .controls {
    right: var(--space-4);
    bottom: var(--space-4);
    padding: 5px 8px;
  }
  .controls__btn { width: 32px; height: 32px; }
  .controls__btn svg { width: 12px; height: 12px; }
  .controls__count { margin: 0 4px; font-size: 10px; }

  /* Hide the slider chrome while the mobile burger menu is open */
  body.menu-open .controls { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
