/* ═══════════════════════════════════════════
   SHIFTLINE MOVING — Custom Styles
   ═══════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* No scroll-behavior: smooth — Lenis handles this */
}

body {
  overflow-x: hidden;
}

/* Lenis overrides */
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;
}

/* ── Grain Overlay ── */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* ── Selection ── */
::selection {
  background: rgba(155, 168, 180, 0.2);
  color: white;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: hsl(220, 12%, 7%);
}

::-webkit-scrollbar-thumb {
  background: hsla(220, 10%, 30%, 0.4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsla(220, 10%, 40%, 0.5);
}

/* ── Navbar ── */
.navbar-glass {
  transition: background-color 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}

.navbar-scrolled .navbar-glass {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(155, 168, 180, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ── Nav Links ── */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: #9BA8B4;
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ── Hero ── */
.hero-headline {
  will-change: transform, opacity;
}

.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 0.8; transform: scaleY(1.2); }
}

/* ── Flow Cards ── */
.flow-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(155, 168, 180, 0.06);
  pointer-events: none;
  transition: border-color 0.5s ease;
}

.flow-card:hover::after {
  border-color: rgba(155, 168, 180, 0.15);
}

/* ── Service Panel hover accent ── */
.service-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 0;
  background: linear-gradient(to bottom, #9BA8B4, transparent);
  transition: height 0.5s ease;
  border-radius: 1px;
}

.service-panel:hover::before {
  height: 60%;
}

/* ── Mobile Menu Animation ── */
#mobile-toggle[aria-expanded="true"] #bar1 {
  transform: translateY(6px) rotate(45deg);
}

#mobile-toggle[aria-expanded="true"] #bar2 {
  opacity: 0;
}

#mobile-toggle[aria-expanded="true"] #bar3 {
  transform: translateY(-6px) rotate(-45deg);
  width: 1.5rem;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-line {
    animation: none;
  }

  .grain-overlay {
    display: none;
  }
}

/* ── Responsive polish ── */
@media (max-width: 768px) {
  .hero-headline {
    line-height: 0.95;
  }
}

/* ── Smooth image loading ── */
img {
  opacity: 1;
  transition: opacity 0.5s ease;
}

img[loading="lazy"] {
  opacity: 0;
}

img[loading="lazy"].loaded {
  opacity: 1;
}
