/* Essential Solutions — engineering-blueprint design system.
   Tokens, layout chrome (header/footer), and Home page components. */

:root {
  --ink: #0E2238;
  --ink-soft: rgba(14, 34, 56, 0.72);
  --ink-line: rgba(14, 34, 56, 0.18);
  --paper: #F5F7F9;
  --paper-soft: rgba(245, 247, 249, 0.72);
  --paper-line: rgba(245, 247, 249, 0.22);
  --cyan: #5B9BD5;
  --cyan-soft: rgba(91, 155, 213, 0.35);
  --cyan-dim: rgba(91, 155, 213, 0.14);
  --copper: #B5652D;
  --copper-hover: #9c5525;

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --measure: 1180px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  margin: 0;
}

a {
  color: var(--cyan);
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- Utility bar (top tier) ---------- */

.utility-bar {
  background: var(--ink);
}

.utility-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  min-height: 36px;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.utility-phone,
.utility-address {
  font-size: 0.82rem;
  color: var(--paper);
  letter-spacing: 0.01em;
}

.utility-phone {
  font-weight: 600;
  text-decoration: none;
}

.utility-phone:hover {
  color: var(--cyan);
}

.utility-address {
  color: var(--paper-soft);
}

.utility-remote {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--paper-soft);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.utility-remote:hover {
  color: var(--cyan);
}

.utility-remote-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

@media (max-width: 560px) {
  .utility-address {
    display: none;
  }

  .utility-remote-label {
    display: none;
  }

  .utility-bar .wrap {
    justify-content: center;
  }
}

/* ---------- Header (bottom tier: main nav bar) ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--ink-line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

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

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--cyan);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
}

@media (min-width: 561px) {
  /* Nav is always visible at desktop widths, regardless of Bootstrap's collapse state. */
  .site-nav.collapse:not(.show) {
    display: flex;
  }
}

@media (max-width: 560px) {
  .site-header .wrap {
    min-height: 0;
  }

  .brand-logo {
    height: 44px;
  }

  .nav-toggle {
    display: flex;
  }

  /* Applies to .site-nav unconditionally (not just .show) so Bootstrap's collapse
     animation - which measures scrollHeight mid-transition while the element
     carries neither the .collapse nor the .show class - sees this grid layout
     instead of falling back to the desktop row layout above. Without this, the
     JS-computed expand height was based on the wrong (shorter) layout, leaving
     a gap between the nav and the hero once the real, taller grid content
     settled in. Hidden state (closed, .collapse:not(.show)) is still handled
     entirely by Bootstrap's own display: none rule, which outranks this one on
     specificity. auto-fill/minmax means adding a nav item (e.g. a Blog link)
     just reflows the grid - no column-count math to update by hand.
     minmax(100px, 1fr) fits the longest label ("SERVICES"/"CONTACT") with room
     to spare and yields ~3 columns on typical phone widths (~375-430px),
     4 near the top of this breakpoint (~480-560px). */
  .site-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    justify-items: start;
    width: 100%;
    gap: 0.7rem 1rem;
    padding: 1rem 0 1.25rem;
  }

  .site-nav a {
    font-size: 0.88rem;
  }
}

/* ---------- Dimension-line divider ---------- */

.dim-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 auto 2.5rem;
  max-width: var(--measure);
  padding: 0 1.5rem;
}

.dim-divider .dim-line {
  flex: 1 1 auto;
  height: 1px;
  background: var(--ink-line);
  position: relative;
}

.dim-divider .dim-line::before,
.dim-divider .dim-line::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--ink-line);
}

.dim-divider .dim-line::before { left: 0; }
.dim-divider .dim-line::after { right: 0; }

.dim-divider .dim-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- Hero ---------- */

.hero {
  background-color: var(--ink);
  background-image:
    linear-gradient(rgba(91, 155, 213, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 155, 213, 0.14) 1px, transparent 1px);
  background-size: 44px 44px;
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.hero .wrap {
  position: relative;
  padding: 6.5rem 1.5rem 5.5rem;
}

.frame {
  position: relative;
}

.corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid var(--cyan);
  opacity: 0.7;
}

.corner-tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.corner-tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.corner-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.corner-br { bottom: 0; right: 0; border-left: none; border-top: none; }

.hero-frame {
  padding: 2.5rem 2.75rem;
  max-width: 760px;
}

@media (max-width: 560px) {
  .hero .wrap {
    padding: 4rem 1rem 3.5rem;
  }

  .hero-frame {
    padding: 1.75rem 1.5rem;
  }
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--cyan);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--paper);
  margin-bottom: 1.4rem;
}

.hero .subhead {
  font-size: 1.1rem;
  color: var(--paper-soft);
  max-width: 620px;
  margin-bottom: 2.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border-radius: 2px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-copper {
  background: var(--copper);
  color: var(--paper);
  border: 1px solid var(--copper);
}

.btn-copper:hover {
  background: var(--copper-hover);
  border-color: var(--copper-hover);
  color: var(--paper);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink-line);
}

.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--ink);
}

/* ---------- Sections ---------- */

.section {
  padding: 5rem 0;
}

.section-narrow .wrap {
  max-width: 880px;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 0.9rem;
}

.section h1,
.section h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.25rem;
  max-width: 760px;
}

.section p.lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 700px;
  margin: 0 0 1.1rem;
}

.section p {
  margin: 0 0 1.1rem;
  max-width: 700px;
}

.section-alt {
  background: #ECEFF3;
}

/* ---------- Schematic diagram ---------- */

.diagram {
  margin-top: 2.75rem;
  border: 1px dashed var(--ink-line);
  padding: 2.5rem 2rem;
}

.diagram-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.diagram-node {
  border: 1px solid var(--ink-line);
  background: var(--paper);
  padding: 1rem 1.5rem;
  text-align: center;
}

.diagram-node-accent {
  border-color: var(--cyan);
  box-shadow: inset 0 0 0 1px var(--cyan-dim);
}

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

.diagram-arrow {
  color: var(--cyan);
  font-size: 1.3rem;
  font-family: var(--font-mono);
}

.diagram-callout {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
}

.diagram-callout-line {
  width: 1px;
  height: 28px;
  background: var(--cyan-soft);
  border-left: 1px dashed var(--cyan);
}

.diagram-callout-card {
  margin-top: 0.75rem;
  border: 1px solid var(--copper);
  padding: 0.9rem 1.4rem;
  text-align: center;
  background: rgba(181, 101, 45, 0.05);
}

.diagram-callout-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--copper);
  margin-bottom: 0.3rem;
}

.diagram-callout-note {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Spec list ---------- */

.spec-list {
  margin-top: 2rem;
  border-top: 1px solid var(--ink-line);
}

.spec-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--ink-line);
}

.spec-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  padding-top: 0.15rem;
}

.spec-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.spec-desc {
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 620px;
}

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

/* ---------- Analyze form ---------- */

.analyze-form {
  margin-top: 2.5rem;
}

.analyze-field-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}

.analyze-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.analyze-input {
  flex: 1 1 320px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-line);
  border-radius: 2px;
  padding: 0.85rem 1rem;
}

.analyze-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-dim);
}

.analyze-field .btn {
  flex: 0 0 auto;
}

.field-error {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--copper);
}

/* ---------- Contact form (stacked fields) ---------- */

.contact-form .analyze-field-group {
  margin-bottom: 1.5rem;
}

.contact-form .analyze-input,
.contact-form .contact-textarea {
  display: block;
  width: 100%;
}

.contact-form .contact-textarea {
  font-family: var(--font-body);
  resize: vertical;
}

.contact-direct {
  margin-top: 3rem;
}

/* Honeypot field for the contact form - visually and programmatically hidden via CSS
   (not the `hidden` attribute or type="hidden") so unsophisticated bots that only
   check for those still find and fill it in. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Note callout ---------- */

.note {
  margin-top: 2.25rem;
  border: 1px dashed var(--ink-line);
  border-left: 3px solid var(--copper);
  padding: 1.25rem 1.5rem;
  position: relative;
}

.note-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 0.6rem;
}

.note p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 660px;
}

/* ---------- Proof panel ---------- */

.proof-panel {
  border: 1px solid var(--ink);
  padding: 3rem 2.5rem;
  position: relative;
  background: var(--paper);
}

.proof-panel h2 {
  max-width: 100%;
}

.proof-panel .cta-row {
  margin-top: 2rem;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: var(--paper-soft);
  border-top: 1px solid var(--cyan-soft);
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 10px;
  height: 4px;
  background: var(--cyan);
}

.site-footer .wrap {
  padding: 1.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-align: center;
}
