/* ==========================================================================
   ENTERPRISE LOGIC — DESIGN SYSTEM
   Concept: control-room / systems-schematic. The brand is literally "Logic" —
   circuits, signal paths, coordinate grids (the firm also builds GIS systems,
   so a literal lat/long grid-reference motif is grounded in the real subject).
   Two accents carry distinct meaning: amber = signal / action, teal = data /
   trace. Background is a warm graphite, not pure black, to avoid the flat
   near-black-plus-neon default.
   ========================================================================== */

:root {
  /* ---- color ---- */
  --bg:          #14171C;
  --bg-raised:   #1B2028;
  --bg-raised-2: #212733;
  --ink:         #ECEFF3;
  --ink-dim:     #93A0AF;
  --ink-faint:   #5B6472;
  --signal:      #E8A33D;
  --signal-dim:  #7A5A2C;
  --trace:       #4FB8AE;
  --trace-dim:   #2C5C57;
  --line:        #2A303A;
  --line-bright: #3B4350;
  --danger:      #D96C5D;

  /* ---- type ---- */
  --f-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
  --f-body:    'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --f-mono:    'IBM Plex Mono', 'Courier New', monospace;

  /* ---- scale ---- */
  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);
  --step-0:  clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1:  clamp(1.2rem, 1.15rem + 0.25vw, 1.375rem);
  --step-2:  clamp(1.5rem, 1.4rem + 0.5vw, 1.875rem);
  --step-3:  clamp(2rem, 1.7rem + 1.2vw, 2.75rem);
  --step-4:  clamp(2.75rem, 2.2rem + 2.2vw, 4rem);
  --step-5:  clamp(3.5rem, 2.6rem + 3.8vw, 5.75rem);

  /* ---- layout ---- */
  --container: 1220px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius-s: 4px;
  --radius-m: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- reset ---- */
*, *::before, *::after { 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 {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

::selection { background: var(--signal); color: #14171C; }

/* faint background grid — the "blueprint" texture, very low contrast */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--trace);
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--trace);
  display: inline-block;
}

/* ==========================================================================
   NAV
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 23, 28, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name small {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-links { display: flex; align-items: center; gap: 2.25rem; }
.nav-links a {
  font-size: 0.92rem;
  color: var(--ink-dim);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--signal);
}
.nav-cta {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--bg) !important;
  background: var(--signal);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-s);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.nav-cta:hover { background: #F2B455; transform: translateY(-1px); }

.nav-toggle { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle::before, .nav-toggle::after { display: none; }
.burger { width: 20px; height: 14px; position: relative; }
.burger i { position: absolute; left: 0; width: 100%; height: 1.5px; background: var(--ink); transition: transform 0.25s var(--ease), opacity 0.2s var(--ease); }
.burger i:nth-child(1) { top: 0; }
.burger i:nth-child(2) { top: 6px; }
.burger i:nth-child(3) { top: 12px; }
.nav-open .burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .burger i:nth-child(2) { opacity: 0; }
.nav-open .burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-links { position: fixed; top: 76px; left: 0; right: 0; bottom: 0; background: var(--bg); flex-direction: column; align-items: flex-start; padding: 2rem var(--gutter); gap: 1.75rem; transform: translateX(100%); transition: transform 0.3s var(--ease); overflow-y: auto; }
  .nav-open .nav-links { transform: translateX(0); }
  .nav-links a { font-size: 1.1rem; }
  .nav-toggle { display: flex; }
  .nav-cta { align-self: flex-start; margin-top: 0.5rem; }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-mono);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-bright);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--signal); border-color: var(--signal); color: var(--bg); }
.btn-primary:hover { background: #F2B455; border-color: #F2B455; transform: translateY(-1px); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { border-color: var(--trace); color: var(--trace); }
.btn-arrow { transition: transform 0.2s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero h1 {
  font-size: var(--step-5);
  max-width: 14ch;
}
.hero .lede {
  font-size: var(--step-1);
  color: var(--ink-dim);
  max-width: 46ch;
  margin-top: 1.5rem;
}
.hero-actions { display: flex; gap: 1rem; margin-top: 2.25rem; flex-wrap: wrap; }

.hero-coord {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  margin-top: 2.5rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.hero-coord span { color: var(--trace); }

/* circuit diagram */
.circuit-box {
  aspect-ratio: 1 / 0.92;
  position: relative;
}
.circuit-box svg { width: 100%; height: 100%; }
.circuit-line {
  fill: none;
  stroke: var(--line-bright);
  stroke-width: 1.5;
}
.circuit-line.live {
  stroke: var(--trace);
  stroke-dasharray: 6 10;
  animation: dash-flow 6s linear infinite;
}
@keyframes dash-flow { to { stroke-dashoffset: -160; } }
.circuit-node { fill: var(--bg-raised); stroke: var(--line-bright); stroke-width: 1.5; }
.circuit-node.on { stroke: var(--signal); }
.circuit-node.on circle.core { fill: var(--signal); }
.circuit-label { font-family: var(--f-mono); font-size: 9px; fill: var(--ink-faint); letter-spacing: 0.05em; }
.circuit-label-core { font-family: var(--f-mono); font-size: 12px; fill: var(--ink); letter-spacing: 0.06em; font-weight: 600; }
.circuit-pulse { fill: var(--signal); opacity: 0; }
@keyframes pulse-appear {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* ==========================================================================
   SECTIONS / SHARED
   ========================================================================== */
section { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.section-border { border-bottom: 1px solid var(--line); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
  flex-wrap: wrap;
}
.section-head h2 { font-size: var(--step-3); max-width: 16ch; }
.section-head .support { max-width: 40ch; color: var(--ink-dim); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- about preview / two-col ---- */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split p + p { margin-top: 1.1rem; }
.split .lede-2 { color: var(--ink-dim); }

.stat-row { display: flex; gap: clamp(1.5rem, 4vw, 3rem); margin-top: 2.25rem; flex-wrap: wrap; }
.stat b { display: block; font-family: var(--f-display); font-size: var(--step-3); color: var(--ink); }
.stat span { font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---- service cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 960px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .card-grid { grid-template-columns: 1fr; } }

.svc-card {
  background: var(--bg);
  padding: 2.25rem 2rem;
  transition: background 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-height: 250px;
}
.svc-card:hover { background: var(--bg-raised); }
.svc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.svc-index { font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-faint); }
.svc-icon { width: 34px; height: 34px; color: var(--trace); }
.svc-card h3 { font-size: var(--step-1); }
.svc-card p { color: var(--ink-dim); font-size: 0.94rem; }
.svc-link { margin-top: auto; font-family: var(--f-mono); font-size: 0.78rem; color: var(--signal); display: inline-flex; align-items: center; gap: 0.4rem; }

/* ---- capability list (dense text rows) ---- */
.cap-list { border-top: 1px solid var(--line); }
.cap-row {
  display: grid;
  grid-template-columns: 90px 1fr 1.3fr;
  gap: 2rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
@media (max-width: 760px) { .cap-row { grid-template-columns: 50px 1fr; } .cap-row .cap-desc { grid-column: 1 / -1; } }
.cap-row .cap-index { font-family: var(--f-mono); color: var(--ink-faint); font-size: 0.8rem; }
.cap-row h4 { font-size: var(--step-0); font-weight: 600; }
.cap-row .cap-desc { color: var(--ink-dim); font-size: 0.92rem; }

/* ---- CTA band ---- */
.band {
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.band-grid { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.band h2 { font-size: var(--step-2); max-width: 22ch; }
.band p { color: var(--ink-dim); margin-top: 0.75rem; max-width: 42ch; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { padding: clamp(3rem, 6vw, 4.5rem) 0 2rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 0.8fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand p { color: var(--ink-dim); font-size: 0.9rem; max-width: 34ch; margin-top: 1rem; }
.footer-col h5 { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 1rem; }
.footer-col a, .footer-col li { display: block; }
.footer-col a { color: var(--ink-dim); font-size: 0.92rem; padding: 0.3rem 0; transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--trace); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 1.75rem; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p { font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-faint); }
.footer-coord { font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-faint); }
.footer-coord span { color: var(--trace); }

/* ==========================================================================
   INNER PAGE HEADER (about/services/products/contact)
   ========================================================================== */
.page-header { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.page-header h1 { font-size: var(--step-4); max-width: 20ch; }
.page-header .lede { color: var(--ink-dim); font-size: var(--step-0); max-width: 52ch; margin-top: 1.25rem; }
.crumb { font-family: var(--f-mono); font-size: 0.75rem; color: var(--ink-faint); margin-bottom: 1.25rem; }
.crumb span { color: var(--trace); }

/* ---- values grid (about) ---- */
.value-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 700px) { .value-grid { grid-template-columns: 1fr; } }
.value-card { background: var(--bg); padding: 2rem; }
.value-card .svc-index { display: block; margin-bottom: 0.9rem; }
.value-card h3 { font-size: var(--step-1); margin-bottom: 0.6rem; }
.value-card p { color: var(--ink-dim); font-size: 0.92rem; }

/* ---- service detail sections ---- */
.svc-detail { display: grid; grid-template-columns: 90px 1fr; gap: 2.5rem; padding: 2.75rem 0; border-bottom: 1px solid var(--line); }
@media (max-width: 700px) { .svc-detail { grid-template-columns: 1fr; gap: 1rem; } }
.svc-detail-num { font-family: var(--f-mono); color: var(--ink-faint); font-size: 0.85rem; }
.svc-detail-body { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 900px) { .svc-detail-body { grid-template-columns: 1fr; } }
.svc-detail h3 { font-size: var(--step-2); margin-bottom: 0.9rem; }
.svc-detail-body p { color: var(--ink-dim); }
.svc-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.svc-tag { font-family: var(--f-mono); font-size: 0.7rem; color: var(--trace); border: 1px solid var(--trace-dim); padding: 0.3rem 0.6rem; border-radius: 3px; }

/* ---- products ---- */
.product-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 2.25rem; display: flex; flex-direction: column; gap: 1rem; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 960px) { .product-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .product-grid { grid-template-columns: 1fr; } }
.product-card ul { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.product-card li { color: var(--ink-dim); font-size: 0.88rem; padding-left: 1.1rem; position: relative; }
.product-card li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 5px; height: 5px; background: var(--trace); }
.note-box { border: 1px dashed var(--line-bright); border-radius: var(--radius-m); padding: 1.5rem 1.75rem; color: var(--ink-dim); font-size: 0.88rem; margin-top: 2.5rem; }
.note-box strong { color: var(--ink); }

/* ---- contact ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 1.4rem; }
.field label { display: block; font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.55rem; }
.field input, .field textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 0.85rem 1rem;
  color: var(--ink);
  transition: border-color 0.2s var(--ease);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--trace); }
.field textarea { min-height: 140px; resize: vertical; }
.form-note { font-size: 0.8rem; color: var(--ink-faint); margin-top: 1rem; }
.contact-info dt { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-top: 1.75rem; }
.contact-info dt:first-child { margin-top: 0; }
.contact-info dd { margin: 0.4rem 0 0; font-size: 1.02rem; }
.social-row { display: flex; gap: 0.75rem; margin-top: 2rem; }
.social-row a { width: 40px; height: 40px; border: 1px solid var(--line-bright); border-radius: var(--radius-s); display: flex; align-items: center; justify-content: center; transition: border-color 0.2s var(--ease), color 0.2s var(--ease); color: var(--ink-dim); }
.social-row a:hover { border-color: var(--trace); color: var(--trace); }
.social-row svg { width: 17px; height: 17px; }

.form-success { display: none; border: 1px solid var(--trace-dim); background: rgba(79,184,174,0.08); color: var(--trace); padding: 1rem 1.25rem; border-radius: var(--radius-s); font-size: 0.9rem; margin-bottom: 1.25rem; font-family: var(--f-mono); }
.form-success.show { display: block; }

/* keyboard focus visibility across the board */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--trace);
  outline-offset: 2px;
}
