/* =============================================================
   JwithKP — Shared Stylesheet
   Covers: design tokens, resets, typography, navbar, footer,
           utilities, Modern Site Refresh, dark/light theme,
           and responsive breakpoints.
   Page-specific styles remain inline in each HTML file.
   ============================================================= */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary:     #0a0f1e;
  --bg-primary-rgb: 10, 15, 30;
  --bg-secondary:   #111827;
  --bg-card:        rgba(17, 25, 40, 0.82);

  /* Text */
  --text-primary:   #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted:     #6b7280;

  /* Accents */
  --accent-primary:   #3b82f6;
  --accent-secondary: #8b5cf6;
  --accent-success:   #10b981;
  --accent-teal:      #0ea5e9;

  /* Gradients */
  --gradient-1: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-btn: linear-gradient(135deg, #0ea5e9 0%, #2563eb 52%, #f97316 100%);

  /* Borders & Shadows */
  --border:  rgba(255, 255, 255, 0.1);
  --shadow:  0 8px 32px rgba(0, 0, 0, 0.35);
}

/* Light theme overrides */
[data-theme="light"] {
  --bg-primary:     #f0f4ff;
  --bg-primary-rgb: 240, 244, 255;
  --bg-secondary:   #e8edf8;
  --bg-card:        rgba(255, 255, 255, 0.88);
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #64748b;
  --border:         rgba(0, 0, 0, 0.1);
  --shadow:         0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ── 2. RESETS & BASE ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  letter-spacing: 0.01em;
  /* Modern Site Refresh gradient background */
  background:
    radial-gradient(circle at 12% 8%,  rgba(14, 165, 233, 0.20), transparent 42%),
    radial-gradient(circle at 84% 14%, rgba(249, 115,  22, 0.16), transparent 38%),
    radial-gradient(circle at 52% 92%, rgba(59, 130, 246, 0.14), transparent 44%),
    var(--bg-primary);
}

/* Subtle grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 18%, transparent 82%);
  -webkit-mask-image: radial-gradient(circle at center, black 18%, transparent 82%);
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.6rem, 5vw, 4.1rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

/* ── 3. LAYOUT UTILITIES ──────────────────────────────────── */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--gradient-1);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

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

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ── 4. BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  font-weight: 700;
  font-family: inherit;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(2, 6, 23, 0.35);
}

.btn-primary {
  background: var(--gradient-btn);
  color: white;
}

.btn-secondary {
  background: rgba(14, 165, 233, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(56, 189, 248, 0.62);
}

/* ── 5. NAVBAR ────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: linear-gradient(
    120deg,
    rgba(var(--bg-primary-rgb), 0.88),
    rgba(15, 23, 42, 0.75)
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 38px rgba(2, 6, 23, 0.32);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background: linear-gradient(
    120deg,
    rgba(var(--bg-primary-rgb), 0.97),
    rgba(15, 23, 42, 0.95)
  );
  box-shadow: 0 4px 24px rgba(2, 6, 23, 0.5);
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo img {
  height: 42px;
  width: auto;
}

.logo-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-copy > span,
.logo > span {
  font-size: 1.45rem;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
  -webkit-text-fill-color: var(--text-muted);
}

/* Nav menu */
.nav-menu {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.nav-menu a {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-menu a.active {
  color: var(--accent-teal);
}

/* Nav right controls */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hamburger */
.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  z-index: 9999;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* ── 6. FOOTER ────────────────────────────────────────────── */
.footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Logo in footer */
.footer .logo img,
.footer-logo-wrap img {
  height: 40px;
  width: auto;
}

.footer-about p {
  color: var(--text-secondary);
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.65;
}

.footer-location {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-links h4 {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-teal);
}

/* Contact column with icons */
.footer-contact ul {
  list-style: none;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.footer-contact li i {
  color: var(--accent-teal);
  margin-top: 0.15rem;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.footer-contact li span {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.footer-contact li strong {
  color: var(--text-primary);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-contact a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

.footer-contact a:hover {
  color: var(--accent-teal);
}

.footer-section-intro {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
  font-size: 0.88rem;
}

.footer-bottom a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-bottom a:hover {
  color: var(--accent-teal);
}

/* ── 7. CARD SHARED STYLES (Modern Site Refresh) ──────────── */
.hero-card,
.hero-panel,
.content-card,
.value-card,
.service-card,
.resource-hub,
.resource-link-card,
.trust-badge,
.offer-panel,
.quote-panel,
.cta-panel,
.post-card,
.industry-card,
.stack-card,
.faq-item,
.calculator-card,
.results-card,
.case-study-card,
.insight-card,
.page-hub-card,
.tech-logo-tile,
.stack-visual-card,
.why-main,
.why-side,
.process-step {
  border-color: rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.26);
}

.post-card:hover,
.service-card:hover,
.value-card:hover,
.content-card:hover,
.industry-card:hover,
.case-study-card:hover,
.insight-card:hover,
.tech-logo-tile:hover,
.page-hub-card:hover,
.process-step:hover {
  transform: translateY(-8px);
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.32);
}

/* ── 8. HERO SHARED STYLES ────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5.5rem 0 3rem;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 32%),
    radial-gradient(circle at top left,  rgba(139, 92, 246, 0.12), transparent 28%);
}

/* Cinematic orb */
.hero::before {
  content: "";
  position: absolute;
  top: -130px;
  right: -80px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.26) 0%, rgba(56, 189, 248, 0) 72%);
  filter: blur(6px);
  z-index: 0;
  pointer-events: none;
}

.hero-copy {
  max-width: 780px;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* ── 9. SCROLL REVEAL ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ── 10. ANIMATED COUNTERS ────────────────────────────────── */
.count-up {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

/* ── 11. FILTER BUTTONS ───────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.filter-btn:hover {
  background: rgba(14, 165, 233, 0.12);
  color: var(--text-primary);
  border-color: rgba(14, 165, 233, 0.4);
}

.filter-btn.active {
  background: var(--gradient-btn);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

/* ── 12. FILTERABLE CARDS ─────────────────────────────────── */
.filterable-card {
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.filterable-card.filter-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── 13. ROI BAR CHART ────────────────────────────────────── */
.roi-chart {
  margin-top: 1.5rem;
}

.roi-chart-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.roi-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 70px;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.roi-bar-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roi-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.roi-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient-btn);
  width: 0%;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.roi-bar-pct {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-teal);
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .roi-bar-row {
    grid-template-columns: 90px 1fr 50px;
    gap: 0.5rem;
  }

  .filter-bar {
    gap: 0.4rem;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.85rem;
  }
}

/* ── 10. TOPBAR (legacy — case-studies, guides) ───────────── */
/* Kept for reference; these pages will be upgraded to .navbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: linear-gradient(
    120deg,
    rgba(var(--bg-primary-rgb), 0.88),
    rgba(15, 23, 42, 0.75)
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 38px rgba(2, 6, 23, 0.32);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand img { height: 38px; }

.brand span {
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-links {
  display: flex;
  gap: 1.5rem;
}

.topbar-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
}

.topbar-links a:hover { color: var(--text-primary); }

/* ── 11. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 980px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Hamburger visible */
  .menu-toggle {
    display: flex;
  }

  /* Nav menu collapses */
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(var(--bg-primary-rgb), 0.97);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem 1rem;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu a {
    padding: 0.75rem 1rem;
    border-radius: 10px;
  }

  /* Navbar becomes relative so menu can position absolutely */
  .navbar {
    position: sticky;
  }

  body::before {
    background-size: 26px 26px;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .hero::before {
    width: 280px;
    height: 280px;
    top: -60px;
    right: -100px;
  }

  .topbar-links {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0.75rem 1rem;
  }

  .container {
    padding: 0 1rem;
  }

  .logo img {
    height: 34px;
  }

  .logo-copy > span,
  .logo > span {
    font-size: 1.2rem;
  }

  .logo-tagline {
    display: none;
  }
}
