/* ============================================
   Custom CSS - Justin Thompson Consulting
   Supplements Tailwind CSS via CDN
   ============================================ */

/* --- Grid Background Pattern --- */
.bg-grid-pattern {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* --- Smooth Scroll --- */
html {
  scroll-behavior: smooth;
}

/* --- Navbar Transition --- */
.navbar {
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* --- Scroll Animations --- */
.fade-in-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Vendor Logo Strip --- */
.vendor-logo {
  opacity: 0.45;
  filter: grayscale(100%) brightness(2);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.vendor-logo:hover {
  opacity: 1;
  filter: grayscale(0%) brightness(1);
}

/* --- Case Study Accordion --- */
.case-study-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.3s ease;
}

.case-study-content.expanded {
  /* max-height managed by JavaScript via scrollHeight */
}

.case-study-toggle .chevron {
  transition: transform 0.3s ease;
}

.case-study-toggle.active .chevron {
  transform: rotate(180deg);
}

/* --- Availability Pulse --- */
.pulse-dot {
  position: relative;
}

.pulse-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
  0% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.5);
  }
}

/* --- Service Card Hover --- */
.service-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* --- Terminal Accent --- */
.terminal-window {
  font-family: 'JetBrains Mono', monospace;
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: #22d3ee;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Process Steps Connector Line --- */
.step-connector {
  position: relative;
}

.step-connector::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -2rem;
  width: 4rem;
  height: 2px;
  background: linear-gradient(to right, #22d3ee, transparent);
}

@media (max-width: 768px) {
  .step-connector::after {
    display: none;
  }
}

/* --- Focus States --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 2px;
}

/* --- Selection Color --- */
::selection {
  background: rgba(34, 211, 238, 0.3);
  color: #f1f5f9;
}

/* --- Scrollbar Styling (Webkit) --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* --- Mobile Menu --- */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-menu.open {
  transform: translateX(0);
}

/* --- Node Connection Lines SVG Background for Hero --- */
.hero-bg-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='400' height='400' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='grid' width='40' height='40' patternUnits='userSpaceOnUse'%3E%3Ccircle cx='20' cy='20' r='1' fill='rgba(34,211,238,0.08)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='400' height='400' fill='url(%23grid)'/%3E%3Cline x1='20' y1='60' x2='100' y2='100' stroke='rgba(34,211,238,0.04)' stroke-width='1'/%3E%3Cline x1='180' y1='20' x2='260' y2='80' stroke='rgba(34,211,238,0.04)' stroke-width='1'/%3E%3Cline x1='300' y1='140' x2='380' y2='180' stroke='rgba(34,211,238,0.04)' stroke-width='1'/%3E%3Cline x1='60' y1='220' x2='140' y2='280' stroke='rgba(34,211,238,0.04)' stroke-width='1'/%3E%3Cline x1='220' y1='300' x2='340' y2='340' stroke='rgba(34,211,238,0.04)' stroke-width='1'/%3E%3C/svg%3E");
}

/* --- Reduced Motion Preference --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .fade-in-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .pulse-dot::before {
    animation: none;
  }
  .terminal-cursor {
    animation: none;
  }
  .service-card {
    transition: none;
  }
  .navbar {
    transition: none;
  }
  .case-study-content {
    transition: none;
  }
  .mobile-menu {
    transition: none;
  }
}
