/* ═══════════════════════════════════════════════════════════
   INTEGRIS — style.css
   Design system: Dark editorial, teal accent, Syne + DM Sans
   ══════════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --color-bg:        #0C202F;
  --color-bg-alt:    #0F2132;
  --color-bg-card:   #13253A;
  --color-surface:   #1A3047;
  --color-border:    rgba(255,255,255,0.07);

  --color-teal:      #2DD4BF;
  --color-teal-dim:  rgba(45,212,191,0.12);
  --color-slate:     #64748B;
  --color-white:     #F8FAFC;
  --color-muted:     #94A3B8;

  --font-display:    'Syne', sans-serif;
  --font-body:       'DM Sans', sans-serif;

  --radius:          8px;
  --radius-lg:       14px;
  --transition:      0.25s ease;

  --nav-height:      72px;
  --container:       1160px;
  --gutter:          clamp(1.25rem, 5vw, 2.5rem);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-white);
  line-height: 1.65;
  font-size: 1rem;
  font-weight: 300;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ══════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.375rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: #2563EB;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.btn--primary:hover {
  background: #1D4ED8;
  box-shadow: 0 6px 20px rgba(37,99,235,0.45);
}

.btn--ghost {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}
.btn--ghost:hover {
  color: var(--color-white);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}

.btn--large {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  border-radius: 10px;
}

/* ══════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12,32,47,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.navbar__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
/* Group 1: target the img element directly; SVG rule removed since logo is now PNG */
.navbar__logo img { display: block; height: 38px; width: auto; }

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar__link {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-muted);
  transition: color var(--transition);
  position: relative;
}
.navbar__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-teal);
  transition: width var(--transition);
}
.navbar__link:hover { color: var(--color-white); }
.navbar__link:hover::after { width: 100%; }

/* Group 1: active link state set by IntersectionObserver in main.js */
.navbar__link--active { color: var(--color-white); }
.navbar__link--active::after { width: 100%; }

/* Hamburger — Group 4: min 44×44px touch target per accessibility guidelines */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
}
.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.navbar__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__hamburger.open span:nth-child(2) { opacity: 0; }
.navbar__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Menu — Group 1: use visibility+opacity instead of display:none so CSS transitions fire.
   display:none removes the element from the render tree, making a "from" state impossible.
   visibility:hidden keeps the element rendered but invisible; transitions work correctly. */
.mobile-menu {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  top: var(--nav-height);
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  background: #0C202F;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2rem var(--gutter);
  z-index: 200;
  gap: 0.5rem;
  visibility: hidden;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  /* delay visibility:hidden until opacity fade finishes on close */
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s 0.3s;
}
.mobile-menu.open {
  visibility: visible;
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
  /* instant visibility on open so element is visible as it fades in */
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s;
}
.mobile-menu__link {
  display: flex;
  align-items: center;
  min-height: 44px; /* Group 4: minimum touch target height */
  padding: 0.75rem 0;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-muted);
  border-bottom: 1px solid var(--color-border);
  transition: color var(--transition);
}
.mobile-menu__link:hover { color: var(--color-white); }
.mobile-menu__cta {
  margin-top: 1.5rem;
  color: #2563EB;
  border: none;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: 5rem;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-teal);
  margin-bottom: 1.25rem;
}

.hero__heading {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--color-white);
  margin-bottom: 1.5rem;
}

.hero__subheading {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: 400;
  color: var(--color-white);
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

.hero__body {
  font-size: 0.95rem;
  color: var(--color-muted);
  max-width: 480px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Hero graphic */
.hero__graphic {
  display: flex;
  justify-content: center;
  align-items: center;
}

.network-svg {
  width: 100%;
  max-width: 420px;
  height: auto;
}

/* ── SVG line dash animation — each pulse class has different duration for organic feel ── */
.net-line {
  stroke-dasharray: 4 6;
  animation: dash 3s linear infinite;
}
@keyframes dash {
  to { stroke-dashoffset: -40; }
}
.pulse-1 { animation-duration: 2.8s; }
.pulse-2 { animation-duration: 3.6s; animation-direction: reverse; }
.pulse-3 { animation-duration: 4.2s; }

/* Group 2: enhanced node pulse includes scale transform for a more alive feel;
   transform-box:fill-box makes transform-origin relative to the element itself in SVG space */
.net-node-c {
  animation: nodePulse 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes nodePulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.2); }
}

/* Group 2: staggered delays break lock-step pulsing so each node feels independent */
.node-c-top    { animation-duration: 2.4s; animation-delay: 0.4s; }
.node-c-bottom { animation-duration: 3.0s; animation-delay: 1.2s; }

/* Group 2: square nodes pulse opacity with individual staggered timing */
.net-node-sq {
  animation: sqPulse 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes sqPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.1); }
}
.node-sq-a { animation-duration: 2.6s; animation-delay: 0s;    }
.node-sq-b { animation-duration: 3.2s; animation-delay: 0.8s;  }
.node-sq-c { animation-duration: 2.9s; animation-delay: 1.5s;  }
.node-sq-d { animation-duration: 3.5s; animation-delay: 2.2s;  }

/* Group 2: hub outer ring breathes in/out with a scale pulse */
.net-hub-ring {
  animation: hubBreath 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes hubBreath {
  0%, 100% { transform: scale(1);    opacity: 0.5; }
  50%       { transform: scale(1.07); opacity: 0.75; }
}

/* Group 2: hub inner ring has a slightly offset breath for depth */
.net-hub-inner {
  animation: hubBreath 5s ease-in-out infinite;
  animation-delay: 0.5s;
  transform-box: fill-box;
  transform-origin: center;
}

/* Group 2: center dot glows with subtle scale — most prominent focal point */
.net-hub-dot {
  animation: dotGlow 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes dotGlow {
  0%, 100% { opacity: 0.9; transform: scale(1);    }
  50%       { opacity: 1;   transform: scale(1.35); }
}

/* Group 2: orbit ring rotates slowly to suggest continuous motion */
.net-orbit {
  animation: orbitSpin 30s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

/* Background dot grid — kept from original */
.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(45,212,191,0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  z-index: 1;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   SECTIONS — shared
   ══════════════════════════════════════════════════════════ */
.section {
  padding-block: 6rem;
}
.section--alt {
  background: var(--color-bg-alt);
}
.section--dark {
  background: var(--color-bg-card);
}

.section__header {
  margin-bottom: 3.5rem;
  max-width: 640px;
}
.section__eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-teal);
  margin-bottom: 0.75rem;
}
.section__heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-white);
}

/* ══════════════════════════════════════════════════════════
   ABOUT
   ══════════════════════════════════════════════════════════ */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.about__text p {
  color: var(--color-muted);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.8;
}
.about__stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* Group 3: inset box-shadow simulates a left border without affecting box model (no layout shift) */
.stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: inset 3px 0 0 transparent;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  border-color: rgba(45,212,191,0.2);
  transform: translateX(4px);
  box-shadow: inset 3px 0 0 var(--color-teal); /* teal left-border accent on hover */
}
.stat-card__number {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-teal);
}
.stat-card__label {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: 400;
}

/* ══════════════════════════════════════════════════════════
   SERVICES
   ══════════════════════════════════════════════════════════ */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.service-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
/* Group 3: cards lift on hover with elevated box-shadow */
.service-card:hover {
  border-color: rgba(45,212,191,0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}
.service-card__icon {
  margin-bottom: 1.25rem;
}
.service-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.75rem;
}
.service-card__body {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.75;
}

/* ══════════════════════════════════════════════════════════
   WHY US
   ══════════════════════════════════════════════════════════ */
.why__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
/* Group 3: teal border-left appears on hover */
.why-item {
  padding: 2rem;
  border-left: 2px solid var(--color-border);
  transition: border-color var(--transition);
}
.why-item:hover { border-color: var(--color-teal); }
.why-item__marker {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-teal);
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}
.why-item__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.6rem;
}
.why-item__body {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.75;
}

/* ══════════════════════════════════════════════════════════
   CONTACT
   ══════════════════════════════════════════════════════════ */
.contact__inner {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}
.contact__body {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-block: 1.25rem 2rem;
  line-height: 1.75;
}

/* ══════════════════════════════════════════════════════════
   CONTACT FORM
   ══════════════════════════════════════════════════════════ */

/* Form wrapper: column flex so rows stack and inherit left-alignment inside the centered card */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  text-align: left;
}

/* Two-column grid row: Email+Phone and Name+Company share this layout */
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Group wrapper keeps label (if ever added) and input together */
.form__group {
  display: flex;
  flex-direction: column;
}

/* Shared input, select, and textarea styles matching the dark theme */
.contact-form input,
.contact-form select,
.contact-form textarea {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-white);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
  /* Prevent textarea horizontal resize from breaking the layout */
  resize: vertical;
}

/* Teal border signals active field matching the brand accent colour */
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--color-teal);
}

/* Placeholder uses the slate tone so it recedes visually */
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--color-slate);
}

/* Hint beneath an input provides example values to guide the user */
.form__hint {
  font-size: 0.8rem;
  color: var(--color-slate);
  margin-top: 0.35rem;
}

/* Remove browser default arrow so our custom SVG chevron is the only indicator */
.contact-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Placeholder option (value="", required) makes select :invalid until a real choice is made */
.contact-form select:invalid {
  color: var(--color-slate);
}

/* Others specify group hidden until JS detects "Others" selection in the ISO dropdown */
#iso-specify-group {
  display: none;
}

/* Alt email link below the demo form button */
.contact__alt-email {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--color-slate);
  text-align: center;
}
.contact__alt-email a {
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
.contact__alt-email a:hover {
  color: var(--color-white);
}

/* Inline error rendered below the submit button by JS */
.form__error {
  font-size: 0.85rem;
  color: #EF4444;
  margin-top: 0.25rem;
}

/* Success state replaces the form after a confirmed submission */
.contact-success {
  text-align: center;
  color: var(--color-teal);
  font-family: var(--font-display);
  font-size: 1.25rem;
  padding: 2.5rem 0;
}

/* Collapse two-column rows to single column on small screens */
@media (max-width: 560px) {
  .form__row {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--color-border);
  padding-block: 2rem;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer__copy {
  font-size: 0.8rem;
  color: var(--color-slate);
}
.footer__links {
  display: flex;
  gap: 1.75rem;
}
.footer__links a {
  font-size: 0.8rem;
  color: var(--color-slate);
  transition: color var(--transition);
}
.footer__links a:hover { color: var(--color-white); }

/* Footer email link */
.footer__email {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-slate);
  transition: color var(--transition);
}
.footer__email:hover {
  color: var(--color-white);
}

/* Footer layout — 3 items now, ensure even spacing */
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* On mobile, stack footer items centered */
@media (max-width: 560px) {
  .footer__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer__email {
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════════════
   SCROLL FADE-IN ANIMATIONS
   ══════════════════════════════════════════════════════════ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in--delay  { transition-delay: 0.2s; }
/* Group 3: second delay tier for staggered service card entrance */
.fade-in--delay-2 { transition-delay: 0.4s; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .navbar__nav { display: none; }
  .navbar__hamburger { display: flex; }

  /* Group 2: graphic moves above text on mobile */
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  .hero__body { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .hero__graphic { order: -1; } /* graphic renders above text column */
  .network-svg { max-width: 300px; }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Group 3: services single column on mobile */
  .services__grid {
    grid-template-columns: 1fr;
  }

  .why__grid {
    grid-template-columns: 1fr;
  }

  .footer__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 560px) {
  /* Group 4: reduced padding, auto height, full-width stacked buttons on small screens */
  .hero { padding-block: 3.5rem; min-height: auto; }
  .section { padding-block: 4rem; }
  .hero__heading { font-size: clamp(3rem, 12vw, 4rem); }
  /* Group 4: full-width stacked CTA buttons on mobile */
  .btn--large { width: 100%; justify-content: center; }
  .hero__actions { flex-direction: column; }
}
