/* ==========================================================================
   Jones Web Design LLC — house stylesheet
   Dark-mode-first, glassmorphism, glowing gradient accents.
   ========================================================================== */

:root {
  --bg: #05070a;
  --surface: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f7fb;
  --text-dim: #9aa6b8;
  --text-dimmer: #667389;
  --cyan: #22d3ee;
  --gradient: linear-gradient(135deg, #3b82ff 0%, #22d3ee 100%);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

::selection {
  background: rgba(59, 130, 255, 0.35);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #1b2433; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2a3650; }

/* ==========================================================================
   Animated background
   ========================================================================== */

.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg);
  overflow: hidden;
}

.bg-aurora::before,
.bg-aurora::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
  animation: drift 26s ease-in-out infinite alternate;
}

.bg-aurora::before {
  background:
    radial-gradient(circle at 30% 30%, #3b82ff 0%, transparent 60%),
    radial-gradient(circle at 70% 70%, #a855f7 0%, transparent 55%);
  top: -15%;
  left: -10%;
}

.bg-aurora::after {
  background:
    radial-gradient(circle at 70% 70%, #22d3ee 0%, transparent 60%),
    radial-gradient(circle at 25% 25%, #a855f7 0%, transparent 55%);
  bottom: -20%;
  right: -10%;
  animation-delay: -12s;
}

/* Cursor glow follower (pointer devices only, see main.js) */
#cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px;
  height: 420px;
  margin-left: -210px;
  margin-top: -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,157,255,0.16) 0%, rgba(168,85,247,0.08) 45%, transparent 72%);
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: transform;
  mix-blend-mode: screen;
}
#cursor-glow.active { opacity: 1; }
@media (pointer: coarse) {
  #cursor-glow { display: none; }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(4%, 6%) scale(1.08); }
  100% { transform: translate(-4%, -3%) scale(0.96); }
}

/* ==========================================================================
   Glass surfaces
   ========================================================================== */

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.glass-strong {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.card-hover {
  position: relative;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.45s ease, box-shadow 0.45s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  border-color: rgba(91, 157, 255, 0.4);
  box-shadow: 0 20px 60px -20px rgba(59, 130, 255, 0.35);
}
/* Spotlight glow that tracks the cursor within the card (set via --mx/--my by main.js) */
.card-hover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(91,157,255,0.16), rgba(168,85,247,0.08) 45%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.card-hover:hover::before { opacity: 1; }

/* Glow ring for buttons/icons */
.glow {
  box-shadow: 0 0 0 1px rgba(91,157,255,0.25), 0 8px 30px -8px rgba(59,130,255,0.55);
}

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  font-weight: 600;
  color: #04070d;
  background: linear-gradient(135deg, #5b9dff, #22d3ee);
  box-shadow: 0 10px 40px -10px rgba(59,130,255,0.6);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), box-shadow 0.35s ease, filter 0.35s ease;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.5), transparent 30%);
  opacity: 0;
  transition: opacity 0.35s ease;
  animation: btn-spin 2.6s linear infinite;
}
.btn-primary:hover::after { opacity: 0.35; }
.btn-primary > * { position: relative; z-index: 1; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-primary:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 16px 50px -8px rgba(34,211,238,0.65);
  filter: brightness(1.06);
}
.btn-primary:active { transform: translateY(0) scale(0.99); }
.btn-primary, .btn-secondary { transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), box-shadow 0.35s ease, filter 0.35s ease, border-color 0.35s ease, background 0.35s ease; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(12px);
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
}
.btn-secondary:hover {
  border-color: rgba(91,157,255,0.55);
  background: rgba(59,130,255,0.08);
  transform: translateY(-2px);
}

/* ==========================================================================
   Nav
   ========================================================================== */

#site-nav {
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  border-bottom: 1px solid transparent;
}
#site-nav.scrolled {
  background: rgba(5, 7, 10, 0.72);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 40px -20px rgba(0,0,0,0.6);
}

.nav-link {
  position: relative;
  color: var(--text-dim);
  transition: color 0.3s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0%;
  height: 2px;
  background: var(--gradient);
  transition: width 0.35s cubic-bezier(0.16,1,0.3,1);
  border-radius: 2px;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16,1,0.3,1);
}
#mobile-menu.open { max-height: 600px; }

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.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; }

/* ==========================================================================
   Floating elements
   ========================================================================== */

.float-slow { animation: floaty 7s ease-in-out infinite; }
.float-slower { animation: floaty 9s ease-in-out infinite; animation-delay: -3s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

#back-to-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
}
#back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   Placeholder imagery (no real photography available)
   ========================================================================== */

.img-placeholder {
  position: relative;
  background:
    radial-gradient(circle at 20% 20%, rgba(59,130,255,0.35), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(34,211,238,0.3), transparent 55%),
    linear-gradient(135deg, #0b0f16, #131a26);
  overflow: hidden;
}
.img-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.6;
}

/* Loading overlay */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070a;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #5b9dff;
  border-right-color: #22d3ee;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* FAQ accordion */
.faq-item .faq-icon { transition: transform 0.35s cubic-bezier(0.16,1,0.3,1); }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16,1,0.3,1), padding 0.4s ease;
}
.faq-item.open .faq-answer { max-height: 400px; }

/* Skip link */
.skip-link:focus {
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 200;
  background: #0b0f16;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-strong);
}

/* Process timeline connector */
.timeline-line {
  background: linear-gradient(180deg, rgba(59,130,255,0.05), rgba(59,130,255,0.6), rgba(34,211,238,0.6), rgba(34,211,238,0.05));
}
@media (min-width: 1024px) {
  .timeline-line-h {
    background: linear-gradient(90deg, rgba(59,130,255,0.05), rgba(59,130,255,0.6), rgba(34,211,238,0.6), rgba(34,211,238,0.05));
  }
}

/* Marquee for logos/tech strip */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track:hover { animation-play-state: paused; }

/* Form validation states (submit-inquiry backend) */
.field-error {
  color: #f87171;
  font-size: 0.75rem;
  margin-top: 0.375rem;
}
.field-invalid {
  border-color: #f87171 !important;
}
[data-form-banner="error"] {
  border-radius: 0.75rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
  font-size: 0.875rem;
  padding: 0.75rem 1rem;
}

/* Neon logo mark pulse */
.jwd-pulse { animation: jwd-neon-pulse 3.4s ease-in-out infinite; }
@keyframes jwd-neon-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Hero mockup tilt (main.js sets transform on mousemove) */
#hero-mockup { perspective: 1200px; }
#hero-mockup-card {
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
  transform-style: preserve-3d;
  will-change: transform;
}

/* ==========================================================================
   Guided site tour
   ========================================================================== */

#tour-highlight {
  position: fixed;
  z-index: 200;
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(4,6,10,0.8), 0 0 44px 6px rgba(34,211,238,0.3);
  border: 2px solid rgba(91,157,255,0.85);
  pointer-events: none;
  opacity: 0;
  transition: top 0.55s cubic-bezier(0.16,1,0.3,1), left 0.55s cubic-bezier(0.16,1,0.3,1),
    width 0.55s cubic-bezier(0.16,1,0.3,1), height 0.55s cubic-bezier(0.16,1,0.3,1), opacity 0.4s ease;
}
#tour-highlight.active { opacity: 1; }

#tour-tooltip {
  position: fixed;
  z-index: 201;
  width: min(320px, calc(100vw - 2.5rem));
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: top 0.55s cubic-bezier(0.16,1,0.3,1), left 0.55s cubic-bezier(0.16,1,0.3,1), opacity 0.4s ease, transform 0.4s ease;
}
#tour-tooltip.active { opacity: 1; transform: translateY(0); pointer-events: auto; }

.tour-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.22);
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
}
.tour-dot.active { background: var(--gradient); width: 18px; border-radius: 4px; }

#tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#tour-backdrop.active { opacity: 1; pointer-events: auto; }

@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;
  }
}
