/* ==========================================================================
   MIDNEX TECHNOLOGIES — DESIGN SYSTEM
   Palette:  --navy #0F1B2D   --charcoal #1C232E   --steel #2E6F9E
             --paper #FFFFFF  --mist #F3F5F7        --line #DCE1E7
   Type:     Manrope (display/headings) + Inter (body/UI)
   ========================================================================== */

:root {
  --navy: #0F1B2D;
  --navy-2: #14263D;
  --charcoal: #1C232E;
  --steel: #2E6F9E;
  --steel-dark: #23577D;
  --paper: #FFFFFF;
  --mist: #F3F5F7;
  --line: #DCE1E7;
  --ink: #1A2230;
  --ink-soft: #4C5A6B;

  --font-display: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --radius-sm: 2px;
  --radius-md: 4px;
  --container-max: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display-heading {
  font-family: var(--font-display);
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

p { color: var(--ink-soft); }

a { color: var(--steel); text-decoration: none; }
a:hover { color: var(--steel-dark); }

.skip-link {
  position: absolute;
  top: -50px;
  left: 8px;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 2000;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
}

.container { max-width: var(--container-max); }

/* ---------------- Header / Navbar ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s ease;
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(15, 27, 45, 0.08); }

.navbar { padding: 14px 0; }
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--navy);
  font-size: 1.05rem;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}
.brand-text { white-space: nowrap; }

.nav-link {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.94rem;
  padding: 8px 14px !important;
  position: relative;
}
.nav-link.active, .nav-link:hover { color: var(--steel); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--steel);
}

.btn-accent {
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.btn-accent:hover { background: var(--steel-dark); border-color: var(--steel-dark); color: #fff; }

.btn-outline-line {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  transition: border-color .2s ease, color .2s ease;
}
.btn-outline-line:hover { border-color: var(--steel); color: var(--steel); }

.btn-light-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
}
.btn-light-outline:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.08); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 55%, var(--steel-dark) 130%);
  color: #fff;
  overflow: hidden;
  padding: 96px 0 88px;
}
.hero::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: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 75%);
  pointer-events: none;
}
.hero-eyebrow-line {
  width: 40px;
  height: 2px;
  background: var(--steel);
  display: inline-block;
  margin-bottom: 18px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  max-width: 15ch;
}
.hero .lead {
  color: rgba(255,255,255,0.78);
  font-size: 1.12rem;
  max-width: 46ch;
  margin: 22px 0 34px;
}
.hero-figure {
  position: relative;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.hero-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.hero-stat { border-left: 2px solid rgba(255,255,255,0.25); padding-left: 14px; }
.hero-stat .num { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: #fff; display: block; }
.hero-stat .label { color: rgba(255,255,255,0.65); font-size: 0.82rem; }

/* ---------------- Section framework ---------------- */
.section { padding: 84px 0; }
.section-tight { padding: 60px 0; }
.section-mist { background: var(--mist); }
.section-navy { background: var(--navy); color: #fff; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-navy p { color: rgba(255,255,255,0.72); }

.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); }
.section-head .kicker {
  color: var(--steel);
  font-weight: 700;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 10px;
}

.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------------- Capability / feature cards ---------------- */
.capability-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  height: 100%;
  background: #fff;
  transition: border-color .2s ease, transform .2s ease;
}
.capability-card:hover { border-color: var(--steel); transform: translateY(-2px); }
.capability-card .icon-tile {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--mist);
  color: var(--steel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 18px;
}
.capability-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.capability-card p { font-size: 0.95rem; margin-bottom: 0; }

/* ---------------- Product / manufacturer reference card ---------------- */
.reference-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}
.reference-card .ref-media {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--mist);
}
.reference-card .ref-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reference-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel-dark);
  background: #E9F1F7;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

/* ---------------- Process steps ---------------- */
.process-steps { counter-reset: step; }
.process-step {
  position: relative;
  padding-left: 56px;
  padding-bottom: 40px;
  border-left: 1px solid var(--line);
  margin-left: 20px;
}
.process-step:last-child { border-left-color: transparent; padding-bottom: 0; }
.process-step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: -21px;
  top: 0;
  width: 40px;
  height: 40px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
}
.process-step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.process-step p { margin-bottom: 0; }

/* ---------------- Project cards ---------------- */
.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 30px;
  background: #fff;
  height: 100%;
}
.project-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }
.project-meta .badge-outline {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
}

/* ---------------- Forms ---------------- */
.form-control, .form-select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.95rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(46, 111, 158, 0.15);
}
.form-label { font-weight: 600; font-size: 0.88rem; color: var(--navy); margin-bottom: 6px; }
.honeypot-field { position: absolute; left: -9999px; top: -9999px; }

.contact-info-panel {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 40px 32px;
}
.contact-info-panel h3 { color: #fff; }
.contact-info-panel p { color: rgba(255,255,255,0.72); }
.contact-info-item { display: flex; gap: 14px; margin-bottom: 20px; }
.contact-info-item i { color: var(--steel); font-size: 1.1rem; margin-top: 3px; }

.alert-success-outline {
  border: 1px solid #2E7D4F;
  background: #EAF6EF;
  color: #1E5C39;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.alert-danger-outline {
  border: 1px solid #B3413A;
  background: #FBEBEA;
  color: #8A2E29;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--charcoal);
  color: rgba(255,255,255,0.75);
  padding: 64px 0 26px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; color: #fff; margin-bottom: 14px; }
.footer-tagline { color: rgba(255,255,255,0.6); margin-bottom: 14px; }
.footer-meta { color: rgba(255,255,255,0.5); font-size: 0.88rem; }
.footer-heading { font-family: var(--font-display); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(255,255,255,0.85); margin-bottom: 16px; }
.footer-links li { margin-bottom: 10px; font-size: 0.92rem; }
.footer-links a { color: rgba(255,255,255,0.65); }
.footer-links a:hover { color: #fff; }
.footer-rule { border-color: rgba(255,255,255,0.12); margin: 40px 0 24px; }
.footer-bottom { font-size: 0.82rem; color: rgba(255,255,255,0.5); }
.footer-note { max-width: 480px; text-align: right; }
@media (max-width: 767px) { .footer-note { text-align: left; } }

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 900;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-2px); color: #fff; }

/* ---------------- Reveal-on-scroll animation ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------------- Counter numbers ---------------- */
.counter-num { font-family: var(--font-display); font-weight: 800; }

/* ---------------- Page header (interior pages) ---------------- */
.page-header {
  background: var(--navy);
  color: #fff;
  padding: 96px 0 72px;
  position: relative;
  overflow: hidden;
}
.page-header-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  z-index: 0;
  transform: scale(1.05);
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(150deg, rgba(15,27,45,0.94) 10%, rgba(15,27,45,0.75) 55%, rgba(35,87,125,0.72) 130%),
    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: auto, 56px 56px, 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.5) 85%);
}
.page-header .container { position: relative; z-index: 2; }
.page-header h1 { color: #fff; font-size: clamp(1.9rem, 3.6vw, 2.6rem); max-width: 20ch; }
.page-header .lead { color: rgba(255,255,255,0.72); max-width: 56ch; margin-top: 14px; }
.breadcrumb-trail { font-size: 0.85rem; color: rgba(255,255,255,0.5); margin-bottom: 18px; }
.breadcrumb-trail a { color: rgba(255,255,255,0.7); }

/* ---------------- Image reveal / zoom effects ---------------- */
.img-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.img-frame:hover img { transform: scale(1.06); }

.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--navy);
  transform-origin: left;
  transform: scaleX(1);
  transition: transform 0.75s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 1;
}
.img-frame.is-visible::after { transform: scaleX(0); }
@media (prefers-reduced-motion: reduce) {
  .img-frame::after { display: none; }
  .img-frame:hover img { transform: none; }
}

.img-caption {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* ---------------- Parallax hero figure ---------------- */
.hero-figure { will-change: transform; }
.hero-figure.img-frame { border-color: rgba(255,255,255,0.15); }
.hero-figure.img-frame::after { background: var(--navy-2); }
.parallax-layer { transition: transform 0.05s linear; }
@media (prefers-reduced-motion: reduce) {
  .parallax-layer { transform: none !important; }
}

/* ---------------- Stat band (animated counters) ---------------- */
.stat-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 48px 0;
}
.stat-item { text-align: center; padding: 0 12px; }
.stat-item .counter-num {
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  color: var(--navy);
  display: block;
  line-height: 1;
}
.stat-item .stat-label {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin-top: 8px;
  display: block;
}

/* ---------------- Image strip / gallery ---------------- */
.image-strip-item { aspect-ratio: 4/3; }
.image-strip-item.tall { aspect-ratio: 3/4; }

/* ---------------- Staggered reveal helper ---------------- */
.reveal { transition-delay: var(--reveal-delay, 0s); }

/* ---------------- Category list (equipment/tech pages) ---------------- */
.category-block { padding: 40px 0; border-bottom: 1px solid var(--line); }
.category-block:last-child { border-bottom: none; }
.category-block h3 { font-size: 1.2rem; }
.tag-pill {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0 8px 8px 0;
}

/* ---------------- Utility ---------------- */
.text-steel { color: var(--steel) !important; }
.bg-mist { background: var(--mist); }
.small-caps-label { font-size: 0.82rem; font-weight: 600; color: var(--steel-dark); }
