/**
 * DAMET | INTRO V6 — Geste Horizontal + Zoom dans la peinture
 * style.css
 * Direction artistique éditoriale haut de gamme
 */

:root {
  --color-ink: #1E2448;
  --color-ink-deep: #141834;
  --color-ink-light: #323966;
  --color-mineral: #6FA9C7;
  --color-mineral-dark: #3F7492;
  --color-mineral-light: #9ECBE2;
  --color-wall: #F5F1EA;
  --color-wall-warm: #FAF8F5;
  --color-border: #C9C4BC;
  --color-border-light: #E2DDD5;
  --color-anthracite: #282B2B;

  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-script: 'Brush Script MT', 'Segoe Script', 'URW Chancery L', cursive;

  --ease-cinematic: cubic-bezier(0.25, 1, 0.5, 1);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background-color: var(--color-wall);
  color: var(--color-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   1. OVERLAY CINÉMATIQUE D'INTRODUCTION & MUR D'APPLICATION
   ========================================================================== */

.intro-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  background-color: var(--color-wall);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  will-change: opacity, transform;
}

.intro-overlay.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  display: none !important;
  pointer-events: none !important;
}

/* Bouton permanent "Passer l'introduction" */
.skip-intro-btn {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(30, 36, 72, 0.06);
}

.skip-intro-btn:hover {
  background: var(--color-ink);
  color: #ffffff;
  border-color: var(--color-ink);
  transform: translateY(-1px);
}

/* Zone de scène plein écran pour le mur */
.intro-stage-area {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Mur d'application plein écran (Suppression complète de l'encadré V6.2) */
.wall {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-wall);
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: hidden;
  transform-origin: center center;
  will-change: transform;
}

/* Grain de plâtre minéral sur le mur */
.wall-plaster-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.065;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
  z-index: 1;
}

#paint-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* Logo initial au centre du mur (+10% sur desktop : 495px de largeur cible) */
.logo-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}

.logo-inner {
  position: relative;
  width: min(600px, 88vw);
  height: auto;
  aspect-ratio: 1000 / 620;
}

.logo-svg-element {
  width: 100%;
  height: 100%;
  display: block;
}

/* Rouleau horizontal unique persistant */
#roller {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  transform-origin: 0% 0%;
  user-select: none;
  will-change: transform, left, top, opacity;
}

/* ==========================================================================
   2. SECTION HERO ARCHITECTURAL (RÉVÉLÉE APRÈS LE ZOOM DANS LA PEINTURE)
   ========================================================================== */

.hero-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background-color: var(--color-wall);
}

/* Arrière-plan photographique immersif */
.hero-bg-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.hero-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transform: scale(1.0);
  will-change: transform;
}

/* Dégradé doux préservant la lisibilité éditoriale */
.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(245, 241, 234, 0.94) 0%,
    rgba(245, 241, 234, 0.88) 45%,
    rgba(245, 241, 234, 0.55) 75%,
    rgba(245, 241, 234, 0.35) 100%
  );
  pointer-events: none;
}

/* En-tête de navigation du site */
.hero-header {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--color-ink);
}

.hero-brand-logo-text {
  display: flex;
  flex-direction: column;
}

.hero-brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}

.hero-brand-sub {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--color-ink-light);
  margin-top: 4px;
}

.hero-nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.hero-nav-links a {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-ink);
  transition: color 0.18s ease;
}

.hero-nav-links a:hover {
  color: var(--color-mineral-dark);
}

.hero-header-cta {
  padding: 10px 22px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--color-ink);
  border: 1px solid var(--color-ink);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(30, 36, 72, 0.14);
}

.hero-header-cta:hover {
  background-color: var(--color-ink-deep);
  transform: translateY(-1px);
}

/* Contenu éditorial principal du Hero */
.hero-main-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 40px 40px 60px 40px;
}

.hero-copy-block {
  max-width: 680px;
}

.hero-badge-artisan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(111, 169, 199, 0.15);
  border: 1px solid rgba(111, 169, 199, 0.40);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-ink);
  margin-bottom: 24px;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-mineral-dark);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.4vw, 56px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.6;
  color: var(--color-ink-light);
  margin-bottom: 36px;
  max-width: 580px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--color-ink);
  border: 1px solid var(--color-ink);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.22s ease;
  box-shadow: 0 4px 14px rgba(30, 36, 72, 0.18);
}

.hero-btn-primary:hover {
  background-color: var(--color-ink-deep);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 36, 72, 0.24);
}

.hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 15px 28px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.22s ease;
}

.hero-btn-secondary:hover {
  background-color: #ffffff;
  border-color: var(--color-ink);
}

/* Pied de page du Hero */
.hero-footer-bar {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(201, 196, 188, 0.4);
  font-size: 11.5px;
  color: var(--color-ink-light);
}

/* ==========================================================================
   3. BARRE FLOTTANTE DE TEST & PROTOCOLE D'INSPECTION
   ========================================================================== */

.intro-test-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(245, 241, 234, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(30, 36, 72, 0.12);
  transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
}

.intro-test-bar.is-collapsed {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(24px) !important;
}

/* Bouton pour fermer/masquer la barre de test */
.test-bar-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-ink-light);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
}

.test-bar-close-btn:hover {
  background: rgba(30, 36, 72, 0.10);
  color: var(--color-ink);
}

/* Pastille discrète de réouverture des contrôles dev */
.test-bar-pill-launcher {
  position: fixed;
  bottom: 16px;
  right: 18px;
  z-index: 199;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink);
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(30, 36, 72, 0.08);
  opacity: 0.72;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.test-bar-pill-launcher:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.test-bar-pill-launcher.is-hidden {
  display: none !important;
}

.test-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-ink);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.test-bar-btn:hover {
  background: var(--color-wall-warm);
  border-color: var(--color-ink);
}

.test-bar-btn[aria-pressed="true"] {
  background: var(--color-ink);
  color: #ffffff;
}

.test-bar-scrubber {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin: 0 4px;
}

.test-bar-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-mineral);
  cursor: pointer;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(30, 36, 72, 0.25);
  transition: transform 0.1s ease;
}

.test-bar-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: var(--color-ink);
}

.test-bar-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-ink-light);
  padding: 0 8px;
}

/* ==========================================================================
   4. RESPONSIVE & ADAPTATION ÉCRANS
   ========================================================================== */

@media (max-width: 860px) {
  .hero-nav-links {
    display: none;
  }
  .hero-gradient-overlay {
    background: linear-gradient(180deg, rgba(245, 241, 234, 0.95) 0%, rgba(245, 241, 234, 0.88) 55%, rgba(245, 241, 234, 0.6) 100%);
  }
  .intro-test-bar {
    width: calc(100% - 24px);
    justify-content: center;
    border-radius: 12px;
  }
}

@media (max-width: 640px) {
  .logo-inner {
    width: min(250px, 66vw);
    transform: translateX(-40px);
  }
  .intro-test-bar {
    width: calc(100% - 16px);
    padding: 6px 8px;
    gap: 4px;
    bottom: 8px;
  }
  .intro-test-bar .test-bar-btn {
    padding: 4px 7px;
    font-size: 10px;
    gap: 3px;
  }
  .test-bar-status {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-overlay {
    display: none !important;
  }
  .hero-bg-image {
    transform: none !important;
  }
}
