/* =============================================================
   BPS INSTALLATIONS — CORE STYLESHEET
   Design tokens + components that sit on top of Tailwind's
   utility classes (loaded via Play CDN, configured in each page).
   ============================================================= */

:root {
  --bg: #0b0b0b;
  --bg-secondary: #111111;
  --bg-elevated: #161616;
  --accent: #d40000;
  --accent-2: #ff2d2d;
  --text: #ffffff;
  --text-secondary: #bdbdbd;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------
   Base / Reset extras
   --------------------------------------------------------------- */
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  overflow-x: hidden;
  cursor: default;
}

h1, h2, h3, h4, h5,
.font-heading {
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

::selection {
  background: var(--accent);
  color: #fff;
}

a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: #262626;
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Film-grain / noise overlay for cinematic depth */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------------------------------------------------------------
   Loading screen
   --------------------------------------------------------------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
}
#preloader .pre-mark {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: 0.02em;
  overflow: hidden;
}
#preloader .pre-bar {
  width: min(280px, 60vw);
  height: 2px;
  background: var(--border-strong);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
#preloader .pre-bar span {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
#preloader .pre-count {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Page cover transition */
#page-cover {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: var(--bg);
  transform: translateY(100%);
  pointer-events: none;
}

/* ---------------------------------------------------------------
   Cursor glow (desktop only)
   --------------------------------------------------------------- */
#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 0, 0, 0.16) 0%, rgba(212, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 5;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  #cursor-glow { display: block; }
}

/* ---------------------------------------------------------------
   Navigation
   --------------------------------------------------------------- */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.75rem clamp(1.25rem, 5vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.5s var(--ease-soft), padding 0.5s var(--ease-soft), border-color 0.5s var(--ease-soft);
  border-bottom: 1px solid transparent;
}
#site-nav.is-scrolled {
  background: rgba(11, 11, 11, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.nav-link {
  position: relative;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}
.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--text);
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn-mobile-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 110;
}
.btn-mobile-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #fff;
  transition: transform 0.4s var(--ease-out), opacity 0.3s ease;
}
.btn-mobile-toggle.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.btn-mobile-toggle.is-open span:nth-child(2) { opacity: 0; }
.btn-mobile-toggle.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: #0b0b0b;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.5s var(--ease-soft), visibility 0.5s;
}
#mobile-menu.is-active {
  visibility: visible;
  opacity: 1;
}
#mobile-menu a {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
}

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.05rem 2.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), background-color 0.4s ease, color 0.4s ease, border-color .4s ease;
  will-change: transform;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 30px -8px rgba(212, 0, 0, 0.55);
}
.btn-primary:hover {
  box-shadow: 0 14px 40px -8px rgba(212, 0, 0, 0.75);
  background: var(--accent-2);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}
.btn-arrow {
  transition: transform 0.4s var(--ease-out);
}
.btn:hover .btn-arrow { transform: translateX(4px); }

/* Magnetic wrapper (JS adds inline transforms to child) */
.magnetic { display: inline-block; }

/* ---------------------------------------------------------------
   Glass cards
   --------------------------------------------------------------- */
.glass-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.5s ease, transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), transparent 40%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.glass-card:hover {
  border-color: rgba(212, 0, 0, 0.35);
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}

.glow-hover {
  position: relative;
}
.glow-hover::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--gx, 50%) var(--gy, 50%), rgba(212,0,0,0.28), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.glow-hover:hover::after { opacity: 1; }

/* ---------------------------------------------------------------
   Hero (Home)
   --------------------------------------------------------------- */
#hero-pin-spacer { position: relative; }
#hero {
  position: relative;
  height: 100vh;
  min-height: 85vh;
  width: 100%;
  overflow: hidden;
  background: #000;
}
#hero-media-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
#hero-media-wrap video,
#hero-media-wrap .hero-fallback,
#hero-media-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#hero-media-wrap img {
  /* scroll-linked zoom: JS animates this from scale(1.1) to scale(1)
     via GSAP ScrollTrigger (transform-only, GPU-accelerated) */
  transform: scale(1.1);
  transform-origin: center center;
  will-change: transform;
}
.hero-fallback {
  background:
    radial-gradient(120% 90% at 15% 10%, rgba(212,0,0,0.20), transparent 55%),
    radial-gradient(120% 100% at 85% 100%, rgba(212,0,0,0.12), transparent 60%),
    linear-gradient(155deg, #1a1a1a 0%, #0b0b0b 55%, #0b0b0b 100%);
}
.hero-fallback .lines {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(115deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 140px);
}
#hero-overlay {
  position: absolute;
  inset: 0;
  /* left-heavy horizontal scrim keeps the left-aligned copy readable
     (~50-58%) while the right side of the photo stays visible (~30%);
     a light vertical scrim adds contrast for the nav and scroll cue */
  background:
    linear-gradient(90deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.48) 40%, rgba(0,0,0,0.3) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.12) 30%, rgba(0,0,0,0.3) 78%, rgba(0,0,0,0.55) 100%);
}
#hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  /* top padding guarantees the headline clears the fixed nav even on
     short viewports, where vertical centering alone would tuck the
     heading up under the logo */
  padding: clamp(7rem, 20vh, 9rem) 1.5rem 3rem;
  overflow-y: auto;
  /* fallback for browsers without `safe` alignment support: never
     overlap the nav, even if that means the block isn't perfectly
     centered on very short viewports */
  justify-content: flex-start;
  /* on browsers that support it, centers normally but falls back to
     the flex-start behavior above instead of overflowing upward into
     the nav when the content is taller than the available space */
  justify-content: safe center;
}
@media (min-width: 768px) {
  #hero-content { padding-left: clamp(2.5rem, 6vw, 6rem); }
}
.hero-word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.05em;
}
.hero-word span {
  display: inline-block;
  transform: translateY(110%);
}
[data-hero-fade] {
  opacity: 0;
  transform: translateY(24px);
}
.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: rgba(255,255,255,0.55);
}
.scroll-cue .stick {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), transparent);
  overflow: hidden;
  position: relative;
}
.scroll-cue .stick::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--accent-2));
  animation: scrollcue 2.2s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { top: -100%; }
  60% { top: 100%; }
  100% { top: 100%; }
}

/* ---------------------------------------------------------------
   Stats
   --------------------------------------------------------------- */
.stat-number {
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------
   Services cards
   --------------------------------------------------------------- */
.service-card {
  padding: 2.5rem 2rem;
  cursor: default;
}
.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 0, 0, 0.1);
  border: 1px solid rgba(212, 0, 0, 0.25);
  color: var(--accent-2);
  transition: transform 0.5s var(--ease-out), background 0.5s ease;
}
.service-card:hover .service-icon {
  transform: rotate(-8deg) scale(1.08);
  background: rgba(212, 0, 0, 0.18);
}

/* ---------------------------------------------------------------
   Gallery / masonry
   --------------------------------------------------------------- */
.g-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: var(--bg-secondary);
}
.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.1s var(--ease-soft), filter 1.1s var(--ease-soft);
  filter: saturate(0.95);
}
.g-item:hover img {
  transform: scale(1.08);
  filter: saturate(1.1);
}
.g-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.g-item:hover .g-caption {
  opacity: 1;
  transform: translateY(0);
}
.filter-btn {
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  transition: all 0.35s ease;
  white-space: nowrap;
}
.filter-btn.is-active,
.filter-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(6,6,6,0.96);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}
#lightbox.is-active { opacity: 1; visibility: visible; }
#lightbox img {
  max-width: min(90vw, 1100px);
  max-height: 80vh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

/* ---------------------------------------------------------------
   Process timeline
   --------------------------------------------------------------- */
.timeline-line {
  position: absolute;
  left: 27px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-strong);
}
@media (min-width: 768px) {
  .timeline-line { left: 50%; }
}
.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 6px rgba(212,0,0,0.12);
}

/* ---------------------------------------------------------------
   Testimonials
   --------------------------------------------------------------- */
.t-track { display: flex; transition: transform 0.7s var(--ease-soft); }
.t-slide { flex: 0 0 100%; }
.t-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: all 0.4s ease;
}
.t-dot.is-active { background: var(--accent); width: 26px; border-radius: 999px; }

.stars { color: var(--accent-2); letter-spacing: 0.15em; }

.avatar-initials {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  background: linear-gradient(155deg, #2a2a2a, #101010);
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.play-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(212,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 20px 50px -12px rgba(212,0,0,0.6);
  transition: transform 0.4s var(--ease-out), background 0.4s ease;
}
.play-btn:hover { transform: scale(1.08); background: var(--accent-2); }

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */
.field {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  color: #fff;
  font-size: 0.95rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.field::placeholder { color: #7a7a7a; }
.field:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.045);
  outline: none;
}
label.field-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------
   Utility reveal classes (targeted by GSAP)
   --------------------------------------------------------------- */
.reveal-up { opacity: 0; transform: translateY(40px); }
.reveal-blur { opacity: 0; filter: blur(16px); transform: scale(1.04); }
.reveal-fade { opacity: 0; }

/* Section spacing rhythm */
.section-pad { padding-top: clamp(5rem, 10vw, 9rem); padding-bottom: clamp(5rem, 10vw, 9rem); }

/* Marquee for logo strip / trust bar */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -60px;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  z-index: 300;
  transition: top 0.3s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------------------------------------------------------------
   Photography placeholders
   (No client photography supplied yet — these read as intentional
   architectural art direction, not broken images. Swap any
   `.ph-photo` element for a real <img>/<video> when assets land.)
   --------------------------------------------------------------- */
.ph-photo {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: linear-gradient(155deg, #1c1c1c 0%, #0e0e0e 60%, #0b0b0b 100%);
}
.ph-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.9;
  background-image:
    repeating-linear-gradient(120deg, rgba(255,255,255,0.045) 0px, rgba(255,255,255,0.045) 1px, transparent 1px, transparent 90px),
    repeating-linear-gradient(30deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 70px);
}
.ph-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tint, radial-gradient(120% 100% at 30% 0%, rgba(212,0,0,0.16), transparent 60%));
}
.ph-photo[data-cat="kitchen"] { --tint: radial-gradient(120% 100% at 20% 0%, rgba(212,0,0,0.22), transparent 60%); }
.ph-photo[data-cat="bathroom"] { --tint: radial-gradient(120% 100% at 80% 0%, rgba(140,160,180,0.18), transparent 60%); }
.ph-photo[data-cat="extension"] { --tint: radial-gradient(120% 100% at 30% 100%, rgba(160,150,120,0.16), transparent 60%); }
.ph-photo[data-cat="mediawall"] { --tint: radial-gradient(120% 100% at 70% 0%, rgba(212,0,0,0.28), transparent 55%); }
.ph-photo[data-cat="garage"] { --tint: radial-gradient(120% 100% at 50% 100%, rgba(150,150,150,0.14), transparent 60%); }
.ph-photo[data-cat="bedroom"] { --tint: radial-gradient(120% 100% at 20% 100%, rgba(160,110,130,0.16), transparent 60%); }

.ph-photo .ph-label {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.ph-photo .ph-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
