/* ==========================================================================
   BNS Development - Master Custom CSS & Design Tokens
   Matching React Tailwind & Index.css
   ========================================================================== */

:root {
  /* Tonal Off-White Canvas & Neutral System */
  --color-bg: #F7F7F5;
  --color-bg-alt: #F2F2EF;
  --color-bg-muted: #ECECE9;
  --color-card: #FCFCFB;
  --color-card-alt: #F7F7F5;

  /* Architectural Borders */
  --color-border: #E6E6E3;
  --color-border-subtle: #ECECE9;
  --color-border-dark: #DEDEDA;

  /* Tonal Charcoal Typography Hierarchy */
  --color-heading: rgba(24, 24, 24, 0.90);
  --color-subheading: rgba(24, 24, 24, 0.75);
  --color-body: rgba(24, 24, 24, 0.60);
  --color-text: rgba(24, 24, 24, 0.90);
  --color-text-secondary: rgba(24, 24, 24, 0.75);
  --color-text-body: rgba(24, 24, 24, 0.60);
  --color-text-muted: rgba(24, 24, 24, 0.45);

  /* Controlled Brand Red Accent */
  --color-red: #ED1C24;
  --color-red-dark: #A31919;
  --color-red-light: rgba(196, 30, 30, 0.08);
}

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

html {
  scroll-behavior: smooth;
  background-color: #F7F7F5;
  color: rgba(24, 24, 24, 0.90);
  font-family: 'Albert Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: #F7F7F5;
  color: rgba(24, 24, 24, 0.90);
  font-family: 'Albert Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2 {
  font-family: 'Playfair Display', Georgia, serif;
  color: rgba(24, 24, 24, 0.90);
  letter-spacing: -0.02em;
  font-weight: 600;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: rgba(24, 24, 24, 0.75);
  letter-spacing: -0.01em;
  font-weight: 600;
}

/* Default body paragraphs (only in light containers without explicit color classes) */
p:not([class*="text-"]) {
  color: rgba(24, 24, 24, 0.60);
  line-height: 1.7;
}

.font-display {
  font-family: 'Playfair Display', Georgia, serif !important;
}

.font-sans {
  font-family: 'Albert Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.font-mono {
  font-family: 'Albert Sans', monospace !important;
  font-feature-settings: 'tnum' on, 'lnum' on;
}

/* ==========================================================================
   Home Page Outline Gradient Buttons (Fluid Flow Interaction)
   ========================================================================== */
.home-outline-btn {
  position: relative;
  background-color: transparent !important;
  border-radius: 9999px;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  transition: all 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Gradient outline via mask */
.home-outline-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  padding: 1.5px;
  background: linear-gradient(90deg, #AA1E23 0%, #C52126 50%, #ED1C24 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* Flowing gradient liquid fill */
.home-outline-btn-fill {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, #AA1E23 0%, #C52126 50%, #ED1C24 100%);
  transform: translateX(-101%);
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
}

.home-outline-btn:hover .home-outline-btn-fill,
.home-outline-btn:focus-visible .home-outline-btn-fill {
  transform: translateX(0%);
}

/* ==========================================================================
   Universal Running Beam Card Outline Effect
   ========================================================================== */
@keyframes cardBeamRun {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -100;
  }
}

.card-beam-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 25;
}

.group:hover .card-beam-overlay,
.card-beam-card:hover .card-beam-overlay,
.card-beam-overlay.is-active {
  opacity: 1;
}

/* ==========================================================================
   Focus Lens Viewfinder Brackets Glider (Navbar)
   ========================================================================== */
#focus-lens-brackets {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s ease;
  pointer-events: none;
}

.lens-corner-tl {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 6px;
  border-left: 1.5px solid #ED1C24;
  border-top: 1.5px solid #ED1C24;
  border-top-left-radius: 3px;
}

.lens-corner-tr {
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #ED1C24;
  border-top: 1.5px solid #ED1C24;
  border-top-right-radius: 3px;
}

.lens-corner-bl {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 6px;
  height: 6px;
  border-left: 1.5px solid #ED1C24;
  border-bottom: 1.5px solid #ED1C24;
  border-bottom-left-radius: 3px;
}

.lens-corner-br {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #ED1C24;
  border-bottom: 1.5px solid #ED1C24;
  border-bottom-right-radius: 3px;
}

/* Nav links blur effect when another link hovered */
#nav-lens-container.is-hovering .nav-item-link {
  opacity: 0.35;
  filter: blur(1.5px);
  transform: scale(0.96);
}

#nav-lens-container.is-hovering .nav-item-link.is-hovered {
  opacity: 1;
  filter: blur(0px);
  transform: scale(1);
}

/* Header Scrolled State */
header.is-scrolled {
  background-color: rgba(247, 247, 245, 0.90) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom-color: #E6E6E3 !important;
  box-shadow: 0 8px 30px -8px rgba(24, 24, 24, 0.06);
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

header.is-scrolled .nav-item-link:not(.is-active),
header.is-light-page .nav-item-link:not(.is-active) {
  color: #2D2D2D !important;
}
header.is-scrolled .nav-item-link:not(.is-active):hover,
header.is-light-page .nav-item-link:not(.is-active):hover {
  color: #181818 !important;
}

header.is-scrolled #mobile-menu-toggle,
header.is-light-page #mobile-menu-toggle {
  background-color: #FCFCFB !important;
  border-color: #E6E6E3 !important;
  color: rgba(0, 0, 0, 0.85) !important;
}
header.is-scrolled #mobile-menu-toggle span[id^="ham-bar-"],
header.is-light-page #mobile-menu-toggle span[id^="ham-bar-"] {
  background-color: #181818 !important;
}

/* ==========================================================================
   Scroll Reveal Animations (Matching Framer Motion luxury ARCH_EASE)
   ========================================================================== */
.reveal-init {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  filter: blur(3px);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

.reveal-init.reveal-left {
  transform: translateX(-36px) scale(0.985);
}

.reveal-init.reveal-right {
  transform: translateX(36px) scale(0.985);
}

.reveal-init.reveal-down {
  transform: translateY(-28px) scale(0.985);
}

.reveal-init.reveal-scale {
  transform: translateY(20px) scale(0.94);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }

.reveal-visible {
  opacity: 1 !important;
  transform: translate(0, 0) scale(1) !important;
  filter: blur(0px) !important;
}

/* Stacking Service Cards Smooth Hover Transitions */
.service-card-stack {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s ease;
}

/* ==========================================================================
   Approach Timeline Line Filling Animation
   ========================================================================== */
.approach-spine-line-fill {
  transform-origin: top center;
  transform: scaleY(0);
  will-change: transform;
}

.approach-spine-dot {
  will-change: transform, opacity;
  transition: box-shadow 0.3s ease-out;
}

/* ==========================================================================
   3D Flip Card Architecture (Hover-to-Flip & Click-to-Flip)
   ========================================================================== */
.perspective-1000 {
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

.transform-style-3d {
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.backface-hidden {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.rotate-y-180 {
  transform: rotateY(180deg) !important;
  -webkit-transform: rotateY(180deg) !important;
}

.flip-card {
  perspective: 1000px;
  -webkit-perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner,
.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: inherit;
}

.flip-card-front {
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
}

.flip-card-back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

/* Smooth Image Hover Scaling */
.hover-scale-img {
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.group:hover .hover-scale-img {
  transform: scale(1.06);
}
