/* ==========================================================================
   RUST MOTORS ENGINE SOLUTIONS — Custom Presentation & Portfolio Styles
   Inspired by boldcomunica.com/injepro/ | Harmonized with Rust Motors 41 Brand
   ========================================================================== */

:root {
  --bg: #060708;
  --surface-1: #0d1013;
  --surface-2: #12161a;
  --surface-3: #181d22;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-mid: rgba(255, 255, 255, 0.14);

  /* Brand Palette from 01 - Logo.png */
  --lime: #84f514;
  --lime-bright: #a3ff33;
  --lime-deep: #5ec204;
  --lime-glow: rgba(132, 245, 20, 0.32);
  --lime-tint: rgba(132, 245, 20, 0.08);
  --lime-border: rgba(132, 245, 20, 0.36);

  --cyan: #00c2ff;
  --cyan-glow: rgba(0, 194, 255, 0.25);
  --cyan-tint: rgba(0, 194, 255, 0.08);
  --cyan-border: rgba(0, 194, 255, 0.32);

  --text-primary: #f4f6f8;
  --text-secondary: #cfd5dc;
  --text-muted: #8b949e;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: "Saira", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}

/* Subtle continuous film grain overlay (faithful to reference) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Custom sleek dark scrollbar */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: #060708;
}
::-webkit-scrollbar-thumb {
  background: #222830;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--lime);
}

/* Top scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--lime-deep), var(--lime), var(--cyan));
  box-shadow: 0 0 14px var(--lime-glow), 0 0 4px var(--lime);
  z-index: 120;
  transition: width 0.08s linear;
}

/* Fixed minimalist topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 32px;
  background: linear-gradient(
    180deg,
    rgba(6, 7, 8, 0.92) 0%,
    rgba(6, 7, 8, 0.62) 60%,
    rgba(6, 7, 8, 0) 100%
  );
  pointer-events: none;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar a,
.topbar button {
  pointer-events: auto;
}

/* Floating Left Sidenav Dot Pill (Desktop) */
.sidenav {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  padding: 14px 9px;
  border-radius: 100px;
  background: rgba(13, 16, 19, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.sidenav-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.sidenav-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
}

.sidenav-dot:hover {
  background: rgba(255, 255, 255, 0.65);
  transform: scale(1.25);
}

.sidenav-dot.active {
  background: var(--lime);
  transform: scale(1.35);
  box-shadow: 0 0 12px var(--lime), 0 0 0 3px rgba(132, 245, 20, 0.18);
}

.sidenav-tooltip {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 6px;
  background: var(--lime);
  color: #060708;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.sidenav-dot:hover .sidenav-tooltip,
.sidenav-dot:focus-visible .sidenav-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Mobile Floating Bottom Navigation Pill */
.mob-nav {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(13, 16, 19, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.mob-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

@media (hover: hover) {
  .mob-nav-btn:hover:not(:disabled) {
    background: var(--lime);
    border-color: var(--lime);
    color: #060708;
  }
}

.mob-nav-btn:active:not(:disabled) {
  background: var(--lime);
  border-color: var(--lime);
  color: #060708;
}

.mob-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

@media (max-width: 1080px) {
  .sidenav {
    display: none;
  }
  .mob-nav {
    display: flex;
  }
  .topbar {
    padding: 14px 18px;
  }
}

/* Full-viewport Slide Sections */
.slide {
  position: relative;
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 108px 0 88px;
  overflow: hidden;
  background-color: var(--bg);
}

.wrap {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 1280px) and (min-width: 1081px) {
  .wrap {
    padding-left: 72px;
    padding-right: 32px;
  }
}

@media (max-width: 768px) {
  .slide {
    padding: 88px 0 124px;
  }
  .wrap {
    padding: 0 20px;
  }
}

/* Thin 1px horizontal divider between slides */
.slide-divider {
  width: 100%;
  max-width: 90%;
  height: 1px;
  margin: 0 auto;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.11) 25%,
    rgba(132, 245, 20, 0.22) 50%,
    rgba(255, 255, 255, 0.11) 75%,
    transparent 100%
  );
}

/* Typography system mirroring Saira reference */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eyebrow-line {
  display: inline-block;
  width: 24px;
  height: 1.5px;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime-glow);
}

.eyebrow-num {
  color: var(--lime);
  font-weight: 800;
}

.eco-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--lime-tint);
  border: 1px solid var(--lime-border);
  color: var(--lime);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.eco-badge-cyan {
  background: var(--cyan-tint);
  border-color: var(--cyan-border);
  color: var(--cyan);
}

.display-h1 {
  font-size: clamp(2.55rem, 5.4vw, 4.55rem);
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: -0.028em;
}

.display-h2 {
  font-size: clamp(2.05rem, 3.85vw, 3.35rem);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.body-lead {
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  font-weight: 300;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* Cards & Surfaces */
.rm-card {
  background: linear-gradient(180deg, rgba(20, 24, 29, 0.88) 0%, rgba(13, 16, 19, 0.94) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  transition: border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease;
}

.rm-card:hover {
  border-color: rgba(132, 245, 20, 0.34);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.rm-card-highlight {
  background: linear-gradient(
    145deg,
    rgba(132, 245, 20, 0.13) 0%,
    rgba(13, 16, 19, 0.95) 65%
  );
  border: 1px solid var(--lime-border);
  border-radius: 10px;
  box-shadow: 0 0 36px rgba(132, 245, 20, 0.08);
}

/* Buttons */
.btn-lime {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--lime-bright) 0%, var(--lime) 55%, var(--lime-deep) 100%);
  color: #060708;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(132, 245, 20, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.btn-lime:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 12px 36px rgba(132, 245, 20, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: transform 0.22s ease, border-color 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}

.btn-outline:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  background: var(--cyan-tint);
  color: #ffffff;
}

/* Full-bleed background photos & overlays */
.slide-bg-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 65% at 12% 52%, rgba(132, 245, 20, 0.15) 0%, transparent 65%),
    radial-gradient(ellipse 40% 50% at 88% 20%, rgba(0, 194, 255, 0.09) 0%, transparent 65%),
    linear-gradient(90deg, rgba(6, 7, 8, 0.96) 0%, rgba(6, 7, 8, 0.84) 44%, rgba(6, 7, 8, 0.45) 100%),
    linear-gradient(180deg, rgba(6, 7, 8, 0.55) 0%, rgba(6, 7, 8, 0.15) 45%, rgba(6, 7, 8, 0.96) 100%);
}

.dark-photo-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 60% at 18% 22%, rgba(132, 245, 20, 0.09) 0%, transparent 70%),
    linear-gradient(180deg, rgba(6, 7, 8, 0.94) 0%, rgba(6, 7, 8, 0.84) 50%, rgba(6, 7, 8, 0.95) 100%);
}

.closing-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 50% at 50% 48%, rgba(132, 245, 20, 0.12) 0%, transparent 70%),
    linear-gradient(180deg, rgba(6, 7, 8, 0.92) 0%, rgba(6, 7, 8, 0.78) 50%, rgba(6, 7, 8, 0.96) 100%);
}

/* Photo cards with bottom gradient caption (Ref Slides 02, 03, 05, 09, 11) */
.photo-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d1013;
}

.photo-frame-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 7, 8, 0.05) 0%,
    rgba(6, 7, 8, 0.18) 52%,
    rgba(6, 7, 8, 0.92) 100%
  );
  pointer-events: none;
}

/* Portfolio Filter Pills */
.filter-pill {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 18, 22, 0.8);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.22s ease;
}

.filter-pill:hover {
  border-color: rgba(132, 245, 20, 0.45);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--lime);
  border-color: var(--lime);
  color: #060708;
  box-shadow: 0 0 20px rgba(132, 245, 20, 0.28);
}

/* Portfolio Cards */
.gallery-item {
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

.gallery-item img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item:hover {
  border-color: rgba(132, 245, 20, 0.48);
}

.gallery-item.is-hidden {
  display: none;
}

/* Ascending 6-step Staircase Timeline (Ref Slide 08) */
.staircase-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  padding-top: 32px;
  border-bottom: 1.5px solid rgba(132, 245, 20, 0.55);
}

.stair-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stair-circle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--lime);
  background: #090b0d;
  border: 1.5px solid rgba(132, 245, 20, 0.65);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stair-step:hover .stair-circle {
  transform: scale(1.08);
  box-shadow: 0 0 18px var(--lime-glow);
}

.stair-step.is-final .stair-circle {
  background: var(--lime);
  color: #060708;
  border-color: var(--lime-bright);
  box-shadow: 0 0 28px rgba(132, 245, 20, 0.55);
}

.stair-stem {
  width: 1.5px;
  background: linear-gradient(180deg, rgba(132, 245, 20, 0.85) 0%, rgba(132, 245, 20, 0.3) 100%);
}

@media (max-width: 960px) {
  .staircase-track {
    grid-template-columns: 1fr;
    gap: 14px;
    border-bottom: none;
    padding-top: 8px;
  }
  .stair-step {
    flex-direction: row;
    text-align: left;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
  }
  .stair-step.is-final {
    background: var(--lime-tint);
    border-color: var(--lime-border);
  }
  .stair-stem {
    display: none;
  }
  .stair-circle {
    flex-shrink: 0;
    order: -1;
  }
}

/* Scroll Reveal Animations (snappy & responsive) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.46s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.d1 { transition-delay: 0.05s; }
.d2 { transition-delay: 0.10s; }
.d3 { transition-delay: 0.15s; }
.d4 { transition-delay: 0.20s; }
.d5 { transition-delay: 0.25s; }

/* Lightbox Modal */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 5, 7, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}

.lightbox-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  transform: scale(0.96);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox-backdrop.open .lightbox-content {
  transform: scale(1);
}

/* Subtle scroll cue pulse */
@keyframes scrollPulse {
  0%, 100% {
    opacity: 0.35;
    transform: scaleY(0.85);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

.scroll-cue-line {
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, var(--lime) 0%, transparent 100%);
  transform-origin: top;
  animation: scrollPulse 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .scroll-cue-line {
    animation: none;
  }
}
