/* =====================================================
   SSET BTP — Design System v2
   Direction "Chantier Industriel"
   ===================================================== */

:root {
  --header-h: 80px;
  --orange: #FF6B00;
  --orange-deep: #E55A00;
  --orange-soft: #FF8A3D;
  --navy: #0B1B33;
  --navy-deep: #061222;
  --concrete: #F4F1EC;
  --concrete-dim: #E8E3D9;
  --line: #DDD7CA;
  --industrial: #1A1A1A;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: #F4F1EC;
  color: #0B1B33;
  overflow-x: hidden;
}

/* ===== TYPOGRAPHIE ===== */
.t-display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.t-hero { font-size: clamp(2.75rem, 5.6vw + 1rem, 5.75rem); line-height: 0.95; letter-spacing: -0.045em; }
.t-h2 { font-size: clamp(2rem, 3vw + 0.8rem, 3.5rem); line-height: 1.02; letter-spacing: -0.03em; }
.t-body { font-size: clamp(1rem, 0.35vw + 0.9rem, 1.125rem); line-height: 1.7; }

.eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

/* ===== RULE (avec accent orange à gauche) ===== */
.rule {
  display: inline-block;
  position: relative;
  width: 64px;
  height: 4px;
  background: var(--orange);
  border-radius: 2px;
  padding-left: 18px;
}
.rule::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 100%;
  background: var(--navy);
  border-radius: 2px;
}

/* ===== GHOST NUMBER (outline style BTP) ===== */
.ghost-num {
  position: absolute;
  top: -0.1em;
  right: -0.02em;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: clamp(11rem, 26vw, 22rem);
  line-height: 0.82;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 107, 0, 0.18);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.ghost-num-light {
  -webkit-text-stroke: 2px rgba(255, 107, 0, 0.32);
}

/* ===== HAZARD TAPE (bande diagonale orange/noir) ===== */
.hazard-tape {
  background: repeating-linear-gradient(
    45deg,
    #FF6B00 0px, #FF6B00 20px,
    #0B1B33 20px, #0B1B33 40px
  );
  height: 8px;
}
.hazard-tape-thin {
  background: repeating-linear-gradient(
    45deg,
    #FF6B00 0px, #FF6B00 10px,
    #0B1B33 10px, #0B1B33 20px
  );
  height: 4px;
}

/* ===== GRAIN (renforcé) ===== */
.grain { position: relative; isolation: isolate; }
.grain::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 320 320' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
.grain-dark::before { opacity: 0.12; mix-blend-mode: soft-light; }
.grain > *:not(.decor):not(.hero-orb):not(.hero-orb-amber) { position: relative; z-index: 2; }
.grain > .decor,
.grain > .hero-orb,
.grain > .hero-orb-amber { position: absolute; z-index: 0; }

/* ===== CONCRETE TEXTURE ===== */
.concrete {
  background-color: var(--concrete);
  background-image:
    linear-gradient(rgba(11,27,51,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,27,51,0.025) 1px, transparent 1px);
  background-size: 100px 100px;
}
.blueprint {
  background-image:
    linear-gradient(rgba(11,27,51,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11,27,51,0.04) 1px, transparent 1px);
  background-size: 72px 72px;
}
.blueprint-dark {
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 72px 72px;
}

/* ===== REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.stagger.visible > * { opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.14s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.23s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.32s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.41s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.50s; }

/* ===== BUTTONS (plus de poids visuel) ===== */
.btn {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.25s ease, color 0.25s ease;
  font-weight: 700;
  letter-spacing: 0.01em;
  will-change: transform;
}

/* Primary — orange chantier */
.btn-primary {
  background: var(--orange);
  color: #0B1B33;
  box-shadow: 0 8px 0 -2px rgba(11, 27, 51, 0.95), 0 12px 28px -10px rgba(255, 107, 0, 0.5);
}
.btn-primary:hover {
  background: var(--orange-deep);
  transform: translateY(-2px);
  box-shadow: 0 10px 0 -2px rgba(11, 27, 51, 0.95), 0 18px 36px -12px rgba(255, 107, 0, 0.6);
}
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 -2px rgba(11, 27, 51, 0.95), 0 6px 16px -6px rgba(255, 107, 0, 0.5);
}

/* Dark — navy plein */
.btn-dark {
  background: var(--navy);
  color: #F4F1EC;
  box-shadow: 0 6px 0 -2px rgba(255, 107, 0, 0.9), 0 12px 28px -12px rgba(11, 27, 51, 0.55);
}
.btn-dark:hover {
  background: var(--navy-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 -2px rgba(255, 107, 0, 0.9), 0 18px 36px -14px rgba(11, 27, 51, 0.65);
}

/* Ghost — contour blanc (sur fond sombre) */
.btn-ghost {
  background: transparent;
  color: #F4F1EC;
  border: 2px solid rgba(244, 241, 236, 0.35);
}
.btn-ghost:hover {
  background: rgba(244, 241, 236, 0.08);
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-2px);
}

/* Amber — réservé aux accents secondaires */
.btn-amber {
  background: #D97706;
  color: #F4F1EC;
  box-shadow: 0 6px 0 -2px rgba(11, 27, 51, 0.95), 0 10px 24px -10px rgba(217, 119, 6, 0.5);
}
.btn-amber:hover {
  background: #B45309;
  transform: translateY(-2px);
}

/* ===== LINKS ===== */
.link-u {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
}
.link-u::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.link-u:hover::after { transform: scaleX(1); }
.link-u:hover { color: var(--orange); }
.icon-nudge { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.group:hover .icon-nudge { transform: translateX(4px); }

/* ===== A11Y ===== */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--concrete-dim); }
::-webkit-scrollbar-thumb { background: var(--navy); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }

/* ===== HEADER (plus marqué) ===== */
#main-header {
  background: rgba(244, 241, 236, 0.92);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 2px solid rgba(11, 27, 51, 0.08);
  position: relative;
}
#main-header .nav-link {
  color: var(--navy);
  font-weight: 600;
  position: relative;
  padding: 0.25rem 0;
}
#main-header .nav-link:hover { color: var(--orange); }
#main-header .nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
#main-header .nav-link:hover::after { transform: scaleX(1); }

/* ===== MOBILE MENU ===== */
#mobile-menu {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobile-menu.hidden-menu { transform: translateX(100%); opacity: 0; pointer-events: none; }
[dir="rtl"] #mobile-menu.hidden-menu { transform: translateX(-100%); }

/* ===== TAGS (style industriel) ===== */
.tag-pill {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--concrete-dim);
  border: 1.5px solid var(--line);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
}
.tag-pill-amber {
  color: var(--orange-deep);
  background: rgba(255, 107, 0, 0.08);
  border-color: rgba(255, 107, 0, 0.3);
}

/* ===== CARDS — bordure gauche orange ===== */
.card-industrial {
  position: relative;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 12px;
  padding: 1.75rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-industrial:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -20px rgba(11, 27, 51, 0.2);
}

/* ===== HERO ===== */
.hero-vh { min-height: 100svh; max-height: 900px; }
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
.hero-slide.active {
  opacity: 1;
  animation: slowPan 14s ease-in-out infinite alternate;
}
@keyframes slowPan {
  0% { transform: scale(1.05) translate(0,0); }
  100% { transform: scale(1.12) translate(-1.5%, -1%); }
}

.hero-mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(60% 80% at 15% 40%, rgba(6,18,34,0.94) 0%, rgba(11,27,51,0.6) 45%, transparent 75%),
    linear-gradient(115deg, rgba(6,18,34,0.96) 0%, rgba(11,27,51,0.78) 55%, rgba(11,27,51,0.4) 100%);
}

/* Bande diagonale signature — côté droit du hero */
.hero-stripe {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 120px;
  background: var(--orange);
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 0% 100%);
  z-index: 2;
  opacity: 0.95;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-stripe-text {
  transform: rotate(90deg);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--navy);
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .hero-stripe { width: 60px; }
  .hero-stripe-text { font-size: 0.6rem; letter-spacing: 0.25em; }
}

.hero-orb {
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  background: radial-gradient(circle, rgba(255, 107, 0, 0.28) 0%, transparent 68%);
  animation: orbFloat 18s ease-in-out infinite;
  z-index: 0;
}
.hero-orb-amber {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
  background: radial-gradient(circle, rgba(255, 107, 0, 0.18) 0%, transparent 68%);
  animation: orbFloat 22s ease-in-out infinite;
  z-index: 0;
}
@keyframes orbFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(30px,-24px) scale(1.08); }
}

.hero-arrow {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 241, 236, 0.10);
  border: 1.5px solid rgba(244, 241, 236, 0.3);
  color: #F4F1EC;
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.hero-arrow:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--navy);
  transform: scale(1.08);
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: rgba(244, 241, 236, 0.35);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.hero-dot.active {
  background: var(--orange);
  width: 28px;
}

/* ===== SECTION HEADER (bloc titre avec trait orange) ===== */
.section-title {
  position: relative;
  padding-left: 1.5rem;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3em;
  bottom: 0.3em;
  width: 5px;
  background: var(--orange);
  border-radius: 2px;
}

/* ===== ANIMATIONS SUPPLEMENTAIRES ===== */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 107, 0, 0); }
}
.pulse-orange { animation: pulseGlow 2.5s ease-in-out infinite; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .stagger > * { opacity: 1; transform: none; transition: none; }
  .hero-slide.active { animation: none; }
  .hero-orb, .hero-orb-amber { animation: none; }
  .pulse-orange { animation: none; }
}

/* ===== MOBILE ===== */
@media (max-width: 640px) {
  section { scroll-margin-top: 72px; }
  .ghost-num { font-size: 9rem; -webkit-text-stroke: 1.5px rgba(255, 107, 0, 0.2); }
}

/* ===== ADMIN — Champs arabes ===== */
.input-arabic,
[dir="rtl"] textarea,
[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="url"] {
  font-family: 'Noto Kufi Arabic', 'Inter', sans-serif;
  text-align: right;
}

/* ===== RTL OVERRIDES ===== */
[dir="rtl"] .rule { padding-left: 0; padding-right: 18px; }
[dir="rtl"] .rule::after { left: auto; right: 0; }
[dir="rtl"] .link-u::after { transform-origin: right; }
[dir="rtl"] .ghost-num { right: auto; left: -0.02em; }
[dir="rtl"] .icon-nudge { transform: scaleX(-1); }
[dir="rtl"] .hero-stripe { right: auto; left: 0; clip-path: polygon(0 0, 60% 0, 100% 100%, 0% 100%); }
[dir="rtl"] .hero-stripe-text { transform: rotate(-90deg); }
[dir="rtl"] .section-title { padding-left: 0; padding-right: 1.5rem; }
[dir="rtl"] .section-title::before { left: auto; right: 0; }
[dir="rtl"] .card-industrial { border-left: 1px solid var(--line); border-right: 4px solid var(--orange); }

/* ===== HEADER FIXED — Garantie forcée ===== */
#main-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 50 !important;
  background: rgba(244, 241, 236, 0.92);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 2px solid rgba(11, 27, 51, 0.08);
  transition: box-shadow 0.3s ease;
}

#main-header.scrolled {
  box-shadow: 0 4px 24px -8px rgba(11, 27, 51, 0.15);
}

#main-header .nav-link {
  color: var(--navy);
  font-weight: 600;
  position: relative;
  padding: 0.25rem 0;
}
#main-header .nav-link:hover { color: var(--orange); }
#main-header .nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
#main-header .nav-link:hover::after { transform: scaleX(1); }
