/* ═══════════════════════════════════════════════════════════════════════
   Wittour — Elevator-inspired motion & animation layer
   Pure CSS (no Tailwind required). Loaded in both dev (CDN) and prod.
   Companion to static/src/input.css which handles Tailwind components.

   Sections:
     1. Elevator Door Reveal (hero)
     2. Floor Indicator (hero overlay)
     3. Service Card Accent (hover interaction — replaces door/seam metaphor)
     4. Floor Rail + Elevator Cab (fixed left scroll indicator)
     5. Scroll Reveal
     6. Slideshow / Réalisations carousel
     7. Reduced-motion overrides  ← always last
═══════════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────────────────────────────
   1. ELEVATOR DOOR REVEAL
   Two absolute panels cover the hero on load then slide apart.
   JS adds .door-open after the next two rAF ticks so the CSS
   transition always fires.  pointer-events:none keeps the
   underlying content keyboard-accessible while the doors are closed.
───────────────────────────────────────────────────────────────────── */
.elevator-door {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 20;
  pointer-events: none;
  will-change: transform, box-shadow;
  /* doors open immediately on symmetric ease; shadow starts fading in at 0.5s */
  transition: transform  1.4s cubic-bezier(0.65, 0, 0.35, 1) 0s,
              box-shadow 0.9s cubic-bezier(0.4, 0, 0.2, 1)   0.5s;
}

/* A: navy brushed-steel panels — denser stripes, navy base gradient */
.elevator-door-left {
  left: 0;
  right: 50%;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0px,
      transparent 27px,
      rgba(255, 255, 255, 0.06) 27px,
      rgba(255, 255, 255, 0.06) 28px
    ),
    linear-gradient(to right, #0D1520 0%, #161D2E 55%, #1C2640 100%);
  /* A: inset depth on the inner (right) edge + C: outer shadow pre-set to transparent */
  box-shadow: inset -6px 0 16px rgba(0, 0, 0, 0.5),
              12px 0 36px rgba(0, 0, 0, 0);
}

.elevator-door-right {
  right: 0;
  left: 50%;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0px,
      transparent 27px,
      rgba(255, 255, 255, 0.06) 27px,
      rgba(255, 255, 255, 0.06) 28px
    ),
    linear-gradient(to left, #0D1520 0%, #161D2E 55%, #1C2640 100%);
  box-shadow: inset 6px 0 16px rgba(0, 0, 0, 0.5),
              -12px 0 36px rgba(0, 0, 0, 0);
}

/* A: center seam — updated to new brand-green */
.elevator-door-left::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 5%,
    rgba(31, 203, 107, 0.7) 25%,
    rgba(31, 203, 107, 0.7) 75%,
    transparent 95%
  );
}

/* B+C: open state — doors slide out, outer shadow fades in as they part */
.elevator-door-left.door-open {
  transform: translateX(-100%);
  box-shadow: inset -6px 0 16px rgba(0, 0, 0, 0.5),
              12px 0 36px rgba(0, 0, 0, 0.35);
}
.elevator-door-right.door-open {
  transform: translateX(100%);
  box-shadow: inset 6px 0 16px rgba(0, 0, 0, 0.5),
              -12px 0 36px rgba(0, 0, 0, 0.35);
}


/* ─────────────────────────────────────────────────────────────────────
   2. FLOOR INDICATOR
   Small floating display in the hero corner that counts up while
   the doors are opening. Hidden on mobile and by JS after doors open.
───────────────────────────────────────────────────────────────────── */
.floor-indicator {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

@media (max-width: 639px) {
  .floor-indicator { display: none; }
}

.floor-indicator-display {
  font-family: 'Manrope', 'Inter', monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: #1FCB6B;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(142, 187, 146, 0.28);
  border-radius: 2px;           /* architectural — was 6px */
  padding: 4px 11px;
  min-width: 50px;
  text-align: center;
  letter-spacing: 0.06em;
  backdrop-filter: blur(6px);
}

.floor-indicator-label {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: 'Inter', sans-serif;
}


/* ─────────────────────────────────────────────────────────────────────
   3. SERVICE CARD ACCENT
   On hover: a brand-green bar grows along the top edge left→right.
   The lift (hover:-translate-y-1) and shadow come from Tailwind classes
   in the template; icon tile fill comes from group-hover Tailwind classes.
   Remove "elevator-panel-card" — this is the replacement.
───────────────────────────────────────────────────────────────────── */
.service-card-accent {
  position: relative;
}

.service-card-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #1FCB6B;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.26s ease;
  z-index: 2;
  pointer-events: none;
}

.service-card-accent:hover::before {
  transform: scaleX(1);
}


/* ─────────────────────────────────────────────────────────────────────
   4. FLOOR RAIL + ELEVATOR CAB
   Desktop only (hidden via `hidden lg:block` in template).
   The shaft is a fixed-height column with two CSS rail lines, evenly
   spaced floor stops, and a small cab element that slides to the active
   floor via JS setting `frCab.style.top`.

   Layout (left→right within the 58px container):
     [label 24px][tick 10px+gap][shaft rail @ left:48px][cab @ left:40–56px]
   Floor spacing: 44px (5 stops → shaft height 198px = 4×44 + 22 cab)
───────────────────────────────────────────────────────────────────── */
.floor-rail {
  position: fixed;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
}

/* Shaft container — holds the rail line, cab, and floor stops */
.fr-shaft {
  position: relative;
  width: 58px;
  height: 198px; /* (4 intervals × 44px) + 22px = height from top of floor-0 to bottom of floor-4 */
}

/* Vertical shaft rail — single bold line */
.fr-shaft::before {
  content: '';
  position: absolute;
  left: 48px;
  top: 11px;    /* half-height of first stop (centered) */
  bottom: 11px; /* half-height of last stop (centered) */
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(94, 138, 96, 0.5) 8%,
    rgba(94, 138, 96, 0.5) 92%,
    transparent 100%
  );
}

/* Elevator cab — the sliding element */
.fr-cab {
  position: absolute;
  left: 40px;       /* centered over the shaft rail at left:48px (40+16/2=48) ✓ */
  width: 16px;
  height: 22px;
  top: 0;           /* JS updates this value */
  background: #161D2E;
  border: 1.5px solid #1FCB6B;
  border-radius: 1px;
  z-index: 2;
  box-shadow:
    0 0 10px rgba(142, 187, 146, 0.28),
    0 1px 4px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: top 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* Door lines inside the cab */
.fr-cab::before,
.fr-cab::after {
  content: '';
  display: block;
  width: 5px;
  height: 1px;
  background: rgba(142, 187, 146, 0.6);
  flex-shrink: 0;
}

/* Floor stops — absolutely positioned within the shaft */
.fr-stop {
  position: absolute;
  left: 0;
  width: 100%;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  outline: none;
  user-select: none;
}

/* Vertical positions — must match FR_STEP = 44 in JS */
.fr-stop[data-index="0"] { top: 0; }
.fr-stop[data-index="1"] { top: 44px; }
.fr-stop[data-index="2"] { top: 88px; }
.fr-stop[data-index="3"] { top: 132px; }
.fr-stop[data-index="4"] { top: 176px; }

.fr-stop:focus-visible {
  outline: 2px solid #1FCB6B;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Floor label (left column) */
.fr-floor-label {
  font-family: 'Manrope', sans-serif;
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(94, 138, 96, 0.38);
  width: 24px;
  text-align: right;
  padding-right: 2px;
  letter-spacing: 0.05em;
  transition: color 0.25s ease;
  line-height: 1;
}

/* Tick mark — horizontal connector from label to shaft */
.fr-tick {
  display: block;
  width: 10px;
  height: 1.5px;
  background: rgba(94, 138, 96, 0.3);
  margin-left: 3px;
  flex-shrink: 0;
  transition: background 0.25s ease, width 0.25s ease;
}

/* Active floor stop */
.fr-stop.active .fr-floor-label {
  color: #1FCB6B;
  font-size: 0.6rem;
}
.fr-stop.active .fr-tick {
  width: 14px;
  background: #1FCB6B;
}


/* ─────────────────────────────────────────────────────────────────────
   5. SCROLL REVEAL
   Elements with .reveal are hidden by default and transition in when
   the IntersectionObserver marks them .visible.
   .reveal-delay-N adds a small stagger for card grids.
───────────────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.42s ease, transform 0.42s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.06s; }
.reveal-delay-2 { transition-delay: 0.12s; }
.reveal-delay-3 { transition-delay: 0.18s; }
.reveal-delay-4 { transition-delay: 0.24s; }
.reveal-delay-5 { transition-delay: 0.30s; }
.reveal-delay-6 { transition-delay: 0.36s; }


/* ─────────────────────────────────────────────────────────────────────
   6. SLIDESHOW / RÉALISATIONS CAROUSEL
───────────────────────────────────────────────────────────────────── */
.slideshow-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 4px;       /* architectural — was 1rem */
  aspect-ratio: 16 / 6;
  background: #161D2E;
}

.slideshow-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slideshow-slide.active { opacity: 1; }

.slideshow-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slideshow-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1.75rem;
  background: linear-gradient(to top, rgba(22, 29, 46, 0.85) 0%, transparent 100%);
  color: white;
  font-family: 'Manrope', sans-serif;
}

.slideshow-caption-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1px;
}

.slideshow-caption-sub {
  font-size: 0.78rem;
  opacity: 0.7;
  font-family: 'Inter', sans-serif;
}

/* Prev/Next arrows — square style to match architectural language */
.slideshow-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 2px;       /* architectural — was 50% */
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  backdrop-filter: blur(4px);
}

.slideshow-arrow:hover { background: rgba(255, 255, 255, 0.26); }

.slideshow-arrow:focus-visible {
  outline: 2px solid #1FCB6B;
  outline-offset: 3px;
}

.slideshow-arrow-prev { left: 0.875rem; }
.slideshow-arrow-next { right: 0.875rem; }

/* Dot indicators — keep circular (they ARE dots) */
.slideshow-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 0.875rem;
}

.slideshow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(94, 138, 96, 0.28);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.22s ease, transform 0.22s ease;
}

.slideshow-dot.active {
  background: #1FCB6B;
  transform: scale(1.45);
}

.slideshow-dot:focus-visible {
  outline: 2px solid #1FCB6B;
  outline-offset: 3px;
  border-radius: 50%;
}


/* ─────────────────────────────────────────────────────────────────────
   7. REDUCED-MOTION OVERRIDES
   Content must ALWAYS be immediately visible.
   This block must remain last so it wins specificity-ties.
───────────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────────
   8. PAGE FADE-IN
   Softens the blank flash on POST→redirect→GET cycles (e.g. language
   switch). 180 ms is short enough not to feel sluggish on regular nav.
───────────────────────────────────────────────────────────────────── */
@keyframes page-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body {
  animation: page-fadein 0.18s ease both;
}


/* ─────────────────────────────────────────────────────────────────────
   7. REDUCED-MOTION OVERRIDES  (always last)
───────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

  /* Doors: start fully open, no delay, no shadow animation */
  .elevator-door { transition: none !important; transition-delay: 0s !important; }
  .elevator-door-left  { transform: translateX(-100%) !important;
                         box-shadow: none !important; }
  .elevator-door-right { transform: translateX(100%)  !important;
                         box-shadow: none !important; }

  /* Floor indicator: never show */
  .floor-indicator { display: none !important; }

  /* Cab: instant jump, no slide */
  .fr-cab { transition: none !important; }

  /* Service card accent: instant on hover */
  .service-card-accent::before { transition: none !important; }

  /* Scroll reveal: elements always visible */
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .reveal-delay-1, .reveal-delay-2, .reveal-delay-3,
  .reveal-delay-4, .reveal-delay-5, .reveal-delay-6 {
    transition-delay: 0s !important;
  }

  /* Slideshow: no fade */
  .slideshow-slide { transition: none !important; }

  /* Page fade-in: skip entirely */
  body { animation: none !important; }
}
