/* =========================================================
   APEX SOLUTIONS — design tokens
   Palette drawn from the logo: navy mark, blue swoosh, grey wordmark.
   Visual language: engineering / as-built drawing sheets — grounded
   in the company's own work (utility & infrastructure plans).
   ========================================================= */

:root {
  --navy: #0a1f44;
  --navy-deep: #071630;
  --blue: #1e6fd9;
  --blue-light: #4a90e2;
  --amber: #e8a33d;
  --paper: #f4f5f2;
  --paper-dim: #eceee9;
  --ink: #101820;
  --slate: #5b6472;
  --slate-light: #8993a1;
  --line: #ccd4de;
  --line-dark: rgba(255, 255, 255, 0.16);

  --font-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --max-w: 1180px;
  --edge: clamp(20px, 5vw, 64px);
}

* { 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;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--navy);
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink); }

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

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

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

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--edge);
  padding-right: var(--edge);
}

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* =========================================================
   Sheet framing — corner ticks + sheet-index tab, used to
   frame major sections like drawing sheets in a plan set.
   ========================================================= */
.sheet {
  position: relative;
  border-top: 1px solid var(--line);
}
.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  top: -1px;
  width: 14px;
  height: 14px;
  border-top: 1px solid var(--slate-light);
}
.sheet::before { left: var(--edge); border-left: 1px solid var(--slate-light); }
.sheet::after { right: var(--edge); border-right: 1px solid var(--slate-light); }

.sheet-tag {
  display: inline-flex;
  gap: 0.6em;
  align-items: center;
  color: var(--slate);
  padding: 22px 0 0;
}
.sheet-tag .num { color: var(--blue); }
.sheet-tag::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  margin-left: 12px;
}

/* =========================================================
   Header / Nav
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  border-bottom: 1px solid var(--line-dark);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img { height: 38px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #cfd8e6;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-links a:hover,
.nav-links a.active { color: #fff; border-color: var(--blue); }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--blue);
  color: #fff !important;
  padding: 10px 18px;
  border-radius: 2px;
  border: 1px solid var(--blue);
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}
.nav-cta:hover { background: var(--blue-light); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-dark);
  color: #fff;
  width: 40px;
  height: 36px;
  border-radius: 2px;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  margin: 0 auto;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .nav.open .nav-links,
  .nav.open .nav-cta {
    display: flex;
  }
  .nav.open {
    flex-wrap: wrap;
  }
  .nav.open .nav-links {
    order: 3;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 16px;
    padding-top: 18px;
  }
  .nav.open .nav-cta { order: 4; margin-top: 14px; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  background: var(--navy);
  color: #fff;
  position: relative;
  overflow: hidden;
  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: 42px 42px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 20%, rgba(30,111,217,0.28), transparent 55%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding-top: 76px;
  padding-bottom: 70px;
}
.hero-tag {
  color: #9fb4d6;
  margin-bottom: 22px;
  display: block;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  max-width: 15ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--blue-light);
}
.hero p.lede {
  color: #c7d1e0;
  font-size: 1.05rem;
  max-width: 46ch;
  margin-top: 18px;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
}
.btn-primary:hover { background: var(--blue-light); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
}
.btn-ghost:hover { border-color: #fff; transform: translateY(-1px); }

/* Schematic diagram */
.schematic {
  position: relative;
}
.schematic svg { width: 100%; height: auto; overflow: visible; }
.schematic .draw-line {
  fill: none;
  stroke: var(--blue-light);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 2.6s ease-out forwards 0.4s;
}
.schematic .draw-line.alt { stroke: #7fb2f2; animation-delay: 0.9s; }
.schematic .node {
  fill: var(--navy);
  stroke: var(--blue-light);
  stroke-width: 2;
  opacity: 0;
  animation: pop 0.5s ease-out forwards;
}
.schematic .n1 { animation-delay: 1.1s; }
.schematic .n2 { animation-delay: 1.9s; }
.schematic .n3 { animation-delay: 2.6s; }
.schematic text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: #b9c6da;
  letter-spacing: 0.05em;
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}
.schematic .l1 { animation-delay: 1.3s; }
.schematic .l2 { animation-delay: 2.1s; }
.schematic .l3 { animation-delay: 2.8s; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }
@keyframes fadeIn { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .schematic .draw-line { stroke-dashoffset: 0; animation: none; }
  .schematic .node, .schematic text { opacity: 1; animation: none; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 48px; }
}

/* =========================================================
   Trust strip
   ========================================================= */
.trust {
  background: var(--navy-deep);
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 36px;
  padding: 18px 0;
}
.trust-row span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fb0c8;
}
.trust-row span b { color: #dfe7f2; font-weight: 500; }

/* =========================================================
   Section basics
   ========================================================= */
section { padding: 64px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-head p { color: var(--slate); font-size: 1.02rem; }

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.service-card {
  background: #fff;
  padding: 34px 28px;
  position: relative;
}
.service-card .tab {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--blue);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 18px;
}
.service-card .icon {
  width: 46px;
  height: 46px;
  margin-bottom: 20px;
}
.service-card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.service-card p { color: var(--slate); font-size: 0.95rem; }
.service-card .more {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.service-card .more:hover { border-color: var(--blue); }

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

/* Capabilities / gov contracting */
.cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
}
.cap-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cap-list li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.cap-list li:last-child { border-bottom: 1px solid var(--line); }
.cap-list .k {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--slate);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 2px;
}
.cap-list .v { color: var(--ink); }
.cap-list .v .placeholder {
  color: var(--blue);
  font-style: italic;
}

.cap-card {
  background: var(--navy);
  color: #fff;
  padding: 34px;
  border-radius: 2px;
}
.cap-card h3 { color: #fff; font-size: 1.2rem; }
.cap-card p { color: #c7d1e0; }

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

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}
.about-figures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 26px;
}
.figure {
  background: #fff;
  padding: 22px;
}
.figure .n {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--navy);
  display: block;
}
.figure .l {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}

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

/* Contact */
.contact-band {
  background: var(--navy);
  color: #fff;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 50px;
}
.contact-info h2 { color: #fff; }
.contact-info p { color: #c7d1e0; }
.contact-info .item {
  margin-top: 22px;
  border-top: 1px solid var(--line-dark);
  padding-top: 16px;
}
.contact-info .item .k {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9fb0c8;
  display: block;
  margin-bottom: 4px;
}
.contact-info .item .v { color: #fff; }

form.contact-form {
  background: #fff;
  padding: 32px;
  border-radius: 2px;
  color: var(--ink);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--paper);
  color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.form-note { font-size: 0.82rem; color: var(--slate); margin-top: 4px; }

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

/* Footer */
.site-footer {
  background: var(--navy-deep);
  color: #9fb0c8;
  padding: 46px 0 28px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line-dark);
}
.footer-top img { height: 30px; margin-bottom: 12px; }
.footer-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #9fb0c8;
}
.footer-nav a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  font-size: 0.78rem;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
