/* Habitat 65 - Custom Architecture & Interactive Styles */

:root {
  --color-primary: #dc2626;      /* Red Habitat 65 */
  --color-primary-dark: #b91c1c;
  --color-dark: #0f172a;         /* Slate 900 */
  --color-charcoal: #1e293b;     /* Slate 800 */
  --color-gray-subtle: #f8fafc;  /* Slate 50 */
  --color-blueprint: rgba(30, 41, 59, 0.08);
}

html {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: #ffffff;
  color: #1e293b;
  overflow-x: hidden;
  position: relative;
}

/* === HEADER NAVBAR (HIDDEN IN HERO, SLIDES DOWN ON SCROLL) === */
#mainHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, background-color 0.3s ease;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

#mainHeader.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* === HERO SECTION (STANDALONE LOGO ASSEMBLY + SUCCESSIVE BLUEPRINTS) === */
.hero-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #ffffff;
  overflow: hidden;
}

/* Blueprint Fading Layers */
.blueprint-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.hero-blueprint-layer {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 2.4s cubic-bezier(0.4, 0, 0.2, 1), transform 14s ease-out;
  transform: scale(1.05);
}

.hero-blueprint-layer.active {
  opacity: 0.12;
  transform: scale(1.0);
}

/* Blueprint grid overlay */
.blueprint-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(226, 232, 240, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
}

/* === HERO LOGO (GRAND VECTORIEL HYPER-NET AVEC IMPACT SLAM) === */
.hero-logo-box {
  position: relative;
  width: 92vw;
  max-width: 820px;
  margin: 0 auto;
  pointer-events: none;
  filter: drop-shadow(0 20px 45px rgba(0, 0, 0, 0.06));
}

@media (min-width: 1024px) {
  .hero-logo-box {
    max-width: 960px;
  }
}

@media (min-width: 1440px) {
  .hero-logo-box {
    max-width: 1060px;
  }
}

.hero-logo-img {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  will-change: transform, opacity;
  animation: heroLogoSlam 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

@keyframes heroLogoSlam {
  0% {
    opacity: 0;
    transform: scale(1.25) translateY(-30px);
  }
  65% {
    opacity: 1;
    transform: scale(0.98) translateY(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* === FEATURE CARDS & PILLARS WITH ILLUSTRATIONS === */
.feature-card {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.3s ease;
  overflow: hidden;
  background-color: #ffffff;
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: #cbd5e1;
  box-shadow: 0 24px 38px -12px rgba(220, 38, 38, 0.09), 0 12px 20px -5px rgba(0, 0, 0, 0.05);
}

.feature-card-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 0.875rem;
  background-color: #f1f5f9;
}

.feature-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover .feature-card-img {
  transform: scale(1.06);
}

.feature-card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  backdrop-filter: blur(8px);
}

/* === BEFORE / AFTER SPLIT SLIDER === */
.before-after-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.12);
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: ew-resize;
  background-color: #0f172a;
}

.ba-image-before,
.ba-image-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-image-after-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  border-right: 2px solid #ffffff;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease;
}

.before-after-container.is-dragging .ba-image-after-wrapper {
  border-right-color: #dc2626;
}

.ba-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background-color: #ffffff;
  border: 3px solid #dc2626;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.before-after-container:hover .ba-slider-handle,
.before-after-container.is-dragging .ba-slider-handle {
  transform: translate(-50%, -50%) scale(1.12);
  background-color: #ffffff;
}

.ba-slider-handle svg {
  width: 20px;
  height: 20px;
  color: #dc2626;
}

.ba-badge {
  position: absolute;
  top: 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 10;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.ba-badge-before {
  right: 1rem;
  background-color: rgba(15, 23, 42, 0.75);
  color: #ffffff;
}

.ba-badge-after {
  left: 1rem;
  background-color: rgba(220, 38, 38, 0.88);
  color: #ffffff;
}

/* FAQ Accordion */
.faq-item {
  transition: all 0.25s ease;
}

.faq-item:hover {
  border-color: #cbd5e1;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: #dc2626;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease-out both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
