/* ============================================================
   QUALITY PRECISION INSPECTIONS — Main Stylesheet
   Mobile-first. Inter font. Navy + Sky Blue brand palette.
   ============================================================ */

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Brand colors */
  --navy:          #0D1F2D;
  --navy-mid:      #132636;
  --navy-dark:     #080F18;
  --blue:          #1e9dcc;   /* sky blue — balanced with green accent */
  --blue-dark:     #1782a8;
  --blue-faint:    #e8f6fc;
  --green:         #2fa67d;   /* emerald accent */
  --green-dark:    #228c67;

  /* Neutrals */
  --white:         #FFFFFF;
  --off-white:     #F5F8FA;
  --text:          #2E3D4F;
  --text-muted:    #64748B;
  --border:        #E2E8F0;
  --border-dark:   rgba(255,255,255,0.10);

  /* Typography */
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --max-w:     1100px;
  --nav-h:     90px;
  --r:         8px;
  --r-lg:      12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.11);

  /* Motion */
  --ease: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent scroll when mobile nav is open */
body.nav-open {
  overflow: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }
button { font-family: var(--font); }

/* ============================================================
   3. CONTAINER
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ============================================================
   4. HEADER & NAV
   ============================================================ */
.header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--navy);
  transition: box-shadow var(--ease);
}

.header.scrolled {
  box-shadow: 0 2px 24px rgba(0,0,0,0.35);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 62px;
  width: auto;
}

/* Desktop nav links */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-block;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  padding: 7px 14px;
  border-radius: var(--r);
  transition: color var(--ease), background var(--ease);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

.nav-link--cta {
  background: var(--blue);
  color: var(--white) !important;
  padding: 8px 18px;
  font-weight: 600;
}

.nav-link--cta:hover {
  background: var(--blue-dark);
}

/* Hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--r);
  transition: background var(--ease);
  flex-shrink: 0;
}

.nav-toggle:hover { background: rgba(255,255,255,0.08); }

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transform-origin: center;
  transition: transform var(--ease), opacity var(--ease);
}

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

/* ============================================================
   5. HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;      /* svh handles mobile browser chrome correctly */
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: calc(var(--nav-h) + 40px) 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('../assets/images/background-circuit-board.jpeg');
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
}

/* Two-layer overlay: deep navy + subtle teal glow on right */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      110deg,
      rgba(8, 15, 24, 0.93) 0%,
      rgba(13, 31, 45, 0.88) 55%,
      rgba(41, 171, 226, 0.12) 100%
    );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 22px;
}

.hero-logo {
  display: block;
  width: 100%;
  max-width: 700px;
  height: auto;
  padding: 0;
  margin: 0 auto 36px;
}

.hero-title {
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.08;
  color: var(--white);
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.75;
  margin: 0 auto 40px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ============================================================
   6. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 14px 28px;
  border-radius: var(--r);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease);
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-align: center;
}

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

.btn--primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 157, 204, 0.38);
}

.btn--ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn--full { width: 100%; }

/* ============================================================
   7. STATS BAR
   ============================================================ */
.stats {
  background: var(--blue);
}

.stats-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  padding-block: 44px;
}

.stat {
  text-align: center;
  padding-inline: 16px;
}

.stat-num {
  display: block;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   8. SECTION BASE
   ============================================================ */
.section {
  padding-block: 96px;
}

.section--alt  { background: var(--off-white); }

.section--dark {
  background: var(--navy);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header--light .section-title { color: var(--white); }
.section-header--light .section-subtitle { color: rgba(255,255,255,0.6); }

.section-title {
  display: inline-block;
  font-size: clamp(1.85rem, 3.5vw, 2.6rem);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.025em;
  margin-bottom: 0;
}

/* Teal underline accent */
.section-title::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  background: var(--blue);
  border-radius: 2px;
  margin: 14px auto 0;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 18px auto 0;
  line-height: 1.7;
}

/* ============================================================
   9. ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 72px;
  align-items: start;
}

.about-text p {
  font-size: 16.5px;
  line-height: 1.82;
  color: var(--text);
  margin-bottom: 22px;
}

.about-text p:last-child { margin-bottom: 0; }

.competencies-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  padding-bottom: 14px;
  border-bottom: 2px solid var(--blue);
  margin-bottom: 4px;
}

.competencies-list li {
  position: relative;
  padding: 11px 0 11px 18px;
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.competencies-list li:last-child { border-bottom: none; }

.competencies-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

/* ============================================================
   10. SERVICES
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.service-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--ease), transform var(--ease);
}

.service-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.service-card-icon {
  width: 44px;
  height: 44px;
  color: var(--green);
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--green);
}

.service-card ul li {
  position: relative;
  padding: 9px 0 9px 18px;
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.service-card ul li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.service-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 17px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
}

/* ============================================================
   11. CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  align-items: start;
}

/* Partner info */
.contact-info-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.40);
  margin-bottom: 28px;
}

.partners {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 36px;
}

.partner {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 18px;
  transition: background var(--ease), border-color var(--ease);
}

.partner:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.13);
}

.partner-name {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  margin-bottom: 4px;
}

.partner-phone {
  font-size: 18px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.01em;
  transition: color var(--ease);
}

.partner-phone:hover { color: #6dcbea; }

.contact-website {
  font-size: 14px;
  color: rgba(255,255,255,0.30);
  padding-top: 28px;
  border-top: 1px solid var(--border-dark);
}

/* Form wrapper */
.contact-form-wrap { position: relative; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Honeypot — visually hidden */
.form-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.req { color: var(--blue); }

.form-group input,
.form-group textarea {
  font-family: var(--font);
  font-size: 16px;
  color: var(--navy);
  background: rgba(255,255,255,0.96);
  border: 2px solid transparent;
  border-radius: var(--r);
  padding: 12px 14px;
  outline: none;
  width: 100%;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9CA3AF;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 157, 204, 0.22);
  background: var(--white);
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
}

/* Success message */
@keyframes success-appear {
  0%   { opacity: 0; transform: translateY(18px) scale(0.96); }
  55%  { opacity: 1; transform: translateY(-4px) scale(1.015); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.form-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 32px;
  background: rgba(47, 166, 125, 0.1);
  border: 1px solid rgba(47, 166, 125, 0.3);
  border-radius: var(--r-lg);
  text-align: center;
}

.form-success[hidden] { display: none; }

.form-success.animate-in {
  animation: success-appear 0.42s cubic-bezier(0.34, 1.25, 0.64, 1) both;
}

.form-success svg {
  width: 52px;
  height: 52px;
  color: var(--green);
}

.form-success p {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

/* ============================================================
   13. FOOTER
   ============================================================ */
.footer {
  background: var(--navy-dark);
  padding-block: 44px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-logo {
  height: 50px;
  width: auto;
  opacity: 0.75;
  transition: opacity var(--ease);
}

.footer-logo:hover { opacity: 1; }

.footer-tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.38);
}

.footer-copy {
  font-size: 13px;
  color: rgba(255,255,255,0.22);
}

/* ============================================================
   14. SCROLL ANIMATIONS
   ============================================================ */
.animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger service cards */
.services-grid .animate:nth-child(2) { transition-delay: 0.08s; }

/* ============================================================
   15. RESPONSIVE — TABLET (max 960px)
   ============================================================ */
@media (max-width: 960px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

/* ============================================================
   16. RESPONSIVE — MOBILE (max 768px)
   ============================================================ */
@media (max-width: 768px) {
  :root { --nav-h: 80px; }

  .logo-img { height: 53px; }

  .section { padding-block: 72px; }

  /* ---- Nav ---- */
  .nav-toggle { display: flex; }

  .nav-menu {
    /* Slide down from header */
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--navy-mid);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 24px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.06);
    z-index: 199;

    /* Hidden by default */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  }

  .nav-menu.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-link {
    display: block;
    padding: 13px 16px;
    font-size: 16px;
    border-radius: var(--r);
  }

  .nav-link--cta {
    text-align: center;
    margin-top: 8px;
  }

  /* ---- Stats ---- */
  .stats-inner {
    grid-template-columns: 1fr;
    padding-block: 36px;
    gap: 0;
  }

  .stat { padding-block: 14px; }

  .stat-divider {
    width: 48px;
    height: 1px;
    margin-inline: auto;
  }

  /* ---- About ---- */
  .about-text p { font-size: 16px; }

  /* ---- Services ---- */
  .services-grid { grid-template-columns: 1fr; }

  /* ---- Contact ---- */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  /* Partners above form on mobile */
  .contact-info { order: -1; }

  .form-row { grid-template-columns: 1fr; }

  /* ---- Section header spacing ---- */
  .section-header { margin-bottom: 44px; }
}

/* ============================================================
   17. RESPONSIVE — SMALL PHONES (max 480px)
   ============================================================ */
@media (max-width: 480px) {
  .container { padding-inline: 16px; }

  .hero {
    padding-block-start: calc(var(--nav-h) + 28px);
    padding-block-end: 64px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn { padding: 14px 24px; }

  .service-card,
  .project-card { padding: 24px 20px; }

  .contact-grid { gap: 36px; }
}
