/**
 * KM Technolabs — Shared Components
 */

/* ========== NAVBAR ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.site-header.is-transparent:not(.is-scrolled) {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.site-header.is-transparent:not(.is-scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.9);
}

.site-header.is-transparent:not(.is-scrolled) .nav-link:hover,
.site-header.is-transparent:not(.is-scrolled) .nav-link.is-active {
  color: white;
}

.navbar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  z-index: 110;
  position: relative;
}

.brand-logo {
  height: 48px;
  width: auto;
  display: block;
}

.brand-logo--light {
  display: none;
}

/* On dark transparent heroes, show light logo */
.site-header.is-transparent:not(.is-scrolled) .brand-logo--dark {
  display: none;
}

.site-header.is-transparent:not(.is-scrolled) .brand-logo--light {
  display: block;
}

.site-footer .brand-logo {
  height: 56px;
}

@media (max-width: 600px) {
  .brand-logo { height: 40px; }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  position: relative;
  padding: 10px 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-link.is-active {
  color: var(--primary);
  font-weight: 600;
}

.nav-cta { margin-left: var(--space-3); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 110;
  position: relative;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s ease;
}

.site-header.is-transparent:not(.is-scrolled) .nav-toggle span {
  background: white;
}

.site-header.menu-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.menu-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 960px) {
  .nav-toggle { display: block; }

  .nav-menu {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: var(--space-7);
  }

  .site-header.menu-open .nav-menu {
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    font-size: var(--text-xl);
    padding: 14px 20px;
  }

  .nav-cta {
    margin: var(--space-4) 0 0;
    width: 100%;
    max-width: 280px;
  }

  .nav-cta .btn { width: 100%; }
}

/* ========== FOOTER ========== */
.site-footer {
  background: #252844;
  color: rgba(255, 255, 255, 0.75);
  padding-top: var(--space-8);
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  background: var(--primary);
  opacity: 0.12;
  top: -80px;
  right: -60px;
  clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: var(--space-7);
  padding-bottom: var(--space-7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.65);
  margin-top: var(--space-4);
  max-width: 320px;
  font-size: var(--text-sm);
}

.footer-col h4 {
  color: white;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-col a {
  color: rgba(255, 255, 255, 0.65);
  font-size: var(--text-sm);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-col a:hover {
  color: var(--primary-light);
  padding-left: 4px;
}

.footer-contact li {
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-sm);
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.footer-contact svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 2px;
}

.social-links {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  color: white;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  padding-left: 0;
}

.social-links svg { width: 18px; height: 18px; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-block: var(--space-5);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.45);
}

.footer-bottom a { color: rgba(255, 255, 255, 0.55); }
.footer-bottom a:hover { color: var(--primary-light); }

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ========== PAGE HERO (inner) ========== */
.page-hero {
  position: relative;
  padding: calc(var(--header-h) + 72px) 0 96px;
  background: var(--gradient-indigo);
  color: white;
  overflow: hidden;
}

.page-hero .parallax-shapes .shape-green {
  background: var(--primary);
  opacity: 0.25;
}

.page-hero h1 {
  color: white;
  margin-bottom: var(--space-4);
  max-width: 720px;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 560px;
  font-size: var(--text-lg);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: var(--space-5);
}

.breadcrumb a { color: rgba(255, 255, 255, 0.7); }
.breadcrumb a:hover { color: white; }
.breadcrumb span[aria-current] { color: var(--primary-light); }

/* ========== CTA BANNER ========== */
.cta-banner {
  position: relative;
  background: var(--gradient-indigo);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 72px);
  overflow: hidden;
  color: white;
}

.cta-banner::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  background: var(--primary);
  opacity: 0.35;
  right: -40px;
  top: -40px;
  clip-path: polygon(30% 0%, 100% 0%, 70% 100%, 0% 100%);
}

.cta-banner::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  background: var(--primary);
  opacity: 0.2;
  left: 8%;
  bottom: -40px;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.cta-banner-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.cta-banner h2 {
  color: white;
  margin-bottom: var(--space-3);
  max-width: 520px;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 480px;
}

/* ========== TECH BADGES ========== */
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--background-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.tech-badge:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-2px);
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: var(--space-4);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(34, 176, 125, 0.15);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-message {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  display: none;
}

.form-message.is-success {
  display: block;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid rgba(34, 176, 125, 0.3);
}

.form-message.is-error {
  display: block;
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

/* ========== FAQ ========== */
.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}

.faq-question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.faq-item.is-open .faq-question svg {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out), padding 0.35s ease;
}

.faq-item.is-open .faq-answer {
  max-height: 320px;
  padding-bottom: var(--space-5);
}

.faq-answer p {
  font-size: var(--text-sm);
  max-width: 720px;
}

/* ========== FILTERS ========== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.filter-btn {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: 0.2s ease;
}

.filter-btn:hover,
.filter-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ========== TIMELINE ========== */
.timeline {
  position: relative;
  display: grid;
  gap: var(--space-6);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.timeline-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--space-5);
  align-items: start;
}

.timeline-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 2px solid var(--primary);
  display: grid;
  place-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--primary);
  position: relative;
  z-index: 1;
}

.timeline-content h3 {
  margin-bottom: var(--space-2);
  font-size: var(--text-lg);
}

.timeline-content p { font-size: var(--text-sm); }

@media (min-width: 900px) {
  .timeline {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
  }

  .timeline::before {
    left: 8%;
    right: 8%;
    top: 20px;
    bottom: auto;
    width: auto;
    height: 2px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .timeline-dot { margin-inline: auto; }
}
