/* =========================================================
   TECHNOGENIS — Shared stylesheet
   Design concept: "Engineering Blueprint" — deep blueprint-navy
   surfaces, drafting grid lines, copper circuit-trace accents,
   cyan signal highlights. Corner "registration marks" and dashed
   circuit traces are the recurring signature motif.
   ========================================================= */

:root {
  /* Color tokens */
  --ink: #0a1f3d;
  --ink-2: #0f2a4d;
  --ink-3: #123b6b;
  --grid-line: #2c5a99;
  --paper: #f4f7fb;
  --paper-2: #e7edf6;
  --copper: #e08a3c;
  --copper-dark: #c06f27;
  --cyan: #3ed6c4;
  --text-dark: #0a1f3d;
  --text-light: #eaf1fb;
  --muted-dark: #46618c;
  --muted-light: #9fb6d9;
  --danger: #d64545;

  /* Type */
  --font-display: "Space Grotesk", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* Layout */
  --max-w: 1180px;
  --radius: 14px;
  --radius-sm: 8px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;

  color-scheme: light;
}

/* ---------- 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; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--text-dark);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--space-2); color: var(--muted-dark); }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-3); }

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

/* ---------- Utility: blueprint grid background ---------- */
.blueprint {
  background-color: var(--ink);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  background-position: center;
  position: relative;
}
.blueprint::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(10,31,61,0) 0%, var(--ink) 72%);
  pointer-events: none;
}
.blueprint > * { position: relative; z-index: 1; }

/* corner registration marks — the signature detail */
.reg-marks { position: relative; }
.reg-marks::before, .reg-marks::after,
.reg-marks .rm-tr, .reg-marks .rm-br {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--copper);
  opacity: 0.55;
}
.reg-marks::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.reg-marks::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--copper); color: #1a0f00; box-shadow: 0 6px 18px rgba(224,138,60,0.35); }
.btn-primary:hover { background: var(--copper-dark); }
.btn-ghost { background: transparent; color: var(--text-light); border-color: rgba(234,241,251,0.35); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-outline-dark { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline-dark:hover { background: var(--ink); color: var(--text-light); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---------- Eyebrow / mono labels ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--copper);
}
.on-dark .eyebrow { color: var(--cyan); }
.on-dark .eyebrow::before { background: var(--cyan); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,31,61,0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(44,90,153,0.6);
}
.nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.85rem var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-light);
  letter-spacing: -0.01em;
}
.brand-text span { color: var(--copper); }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-links a {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--muted-light);
  transition: color 0.15s ease;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--text-light);
  border-bottom-color: var(--copper);
}
.nav-cta { display: flex; align-items: center; gap: 0.75rem; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--grid-line);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  color: var(--text-light);
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ink);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0 var(--space-3);
    max-height: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--grid-line);
    transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 420px; padding: var(--space-2) var(--space-3) var(--space-3); }
  .nav-links a { width: 100%; padding: 0.7rem 0; border-bottom: 1px solid rgba(44,90,153,0.4); }
  .nav-cta .btn-ghost { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-6) 0 var(--space-5);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
}
.hero h1 { color: var(--text-light); }
.hero-lead { color: var(--muted-light); font-size: 1.1rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 1rem; margin-top: var(--space-3); flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(44,90,153,0.6);
}
.hero-stats div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--cyan);
}
.hero-stats div span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; }

.trace-dash { stroke-dasharray: 6 7; animation: dash-move 3.2s linear infinite; }
@keyframes dash-move { to { stroke-dashoffset: -130; } }
.pulse-node { animation: pulse 2.4s ease-in-out infinite; transform-origin: center; }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; row-gap: var(--space-2); }
}

/* ---------- Sections ---------- */
.section { padding: var(--space-6) 0; }
.section-tight { padding: var(--space-5) 0; }
.section-head { max-width: 62ch; margin-bottom: var(--space-4); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.on-dark { background: var(--ink); color: var(--text-light); }
.on-dark h2, .on-dark h3, .on-dark .brand-text { color: var(--text-light); }
.on-dark p { color: var(--muted-light); }
.on-paper-2 { background: var(--paper-2); }

/* ---------- Grid / Cards ---------- */
.grid { display: grid; gap: var(--space-3); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: #fff;
  border: 1px solid #dfe7f2;
  border-radius: var(--radius);
  padding: var(--space-3);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(10,31,61,0.08); border-color: var(--copper); }
.card .card-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--ink);
  margin-bottom: var(--space-2);
  color: var(--cyan);
}
.card h3 { margin-bottom: 0.4rem; }
.card p { margin-bottom: 0.6rem; font-size: 0.95rem; }
.card-link { font-family: var(--font-mono); font-size: 0.8rem; color: var(--copper-dark); }

.service-card-dark {
  background: var(--ink-3);
  border: 1px solid var(--grid-line);
  border-radius: var(--radius);
  padding: var(--space-3);
  color: var(--text-light);
}
.service-card-dark h3 { color: var(--text-light); }
.service-card-dark p { color: var(--muted-light); }
.service-card-dark .tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  border: 1px solid var(--grid-line);
  color: var(--cyan);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

/* ---------- Process steps (real sequence — numbering justified) ---------- */
.process-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); counter-reset: step; }
.process-item { position: relative; padding-top: var(--space-3); border-top: 2px dashed var(--grid-line); }
.process-item::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--font-mono);
  color: var(--copper);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.5rem;
}
@media (max-width: 900px) { .process-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .process-list { grid-template-columns: 1fr; } }

/* ---------- Divider trace ---------- */
.circuit-divider { display: block; width: 100%; height: 28px; margin: 0 auto; }

/* ---------- Testimonials ---------- */
.quote-card {
  background: #fff;
  border-left: 3px solid var(--copper);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  box-shadow: 0 8px 24px rgba(10,31,61,0.06);
}
.quote-card p { color: var(--text-dark); font-size: 1.02rem; }
.quote-meta { display: flex; align-items: center; gap: 0.7rem; margin-top: var(--space-2); }
.quote-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink); color: var(--cyan);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
}
.quote-meta strong { display: block; font-size: 0.9rem; }
.quote-meta span { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-dark); }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink);
  border-radius: var(--radius);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.cta-band h2 { color: var(--text-light); margin-bottom: 0.3rem; }
.cta-band p { color: var(--muted-light); margin-bottom: 0; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: var(--space-2); }
.field.full { grid-column: 1 / -1; }
.field label { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-dark); }
.field input, .field select, .field textarea {
  font: inherit;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cfd9e8;
  background: #fff;
  color: var(--text-dark);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--copper);
  outline: none;
  box-shadow: 0 0 0 3px rgba(224,138,60,0.15);
}
.field textarea { resize: vertical; min-height: 120px; }
.field .hint { font-size: 0.78rem; color: var(--muted-dark); font-family: var(--font-mono); }
.field .error-msg { font-size: 0.8rem; color: var(--danger); display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field.invalid .error-msg { display: block; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.form-panel {
  background: #fff;
  border: 1px solid #dfe7f2;
  border-radius: var(--radius);
  padding: var(--space-4);
}
.form-note { font-size: 0.85rem; color: var(--muted-dark); margin-top: var(--space-2); }
.form-success {
  display: none;
  background: #ecfbf9;
  border: 1px solid var(--cyan);
  color: #0a5a52;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  margin-bottom: var(--space-2);
}
.form-success.show { display: block; }

/* ---------- Slots (consultation) ---------- */
.slot-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.slot {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid #cfd9e8;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: all .15s ease;
}
.slot:hover { border-color: var(--copper); }
.slot.selected { background: var(--ink); color: var(--text-light); border-color: var(--ink); }

/* ---------- Blog ---------- */
.blog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.blog-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #cfd9e8;
  background: #fff;
  cursor: pointer;
}
.filter-btn.active { background: var(--ink); color: var(--text-light); border-color: var(--ink); }
.search-box {
  font: inherit;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #cfd9e8;
  min-width: 220px;
}
.post-card {
  background: #fff;
  border: 1px solid #dfe7f2;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(10,31,61,0.08); }
.post-thumb {
  height: 150px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  color: rgba(234,241,251,0.85);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.post-body { padding: var(--space-3); }
.post-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted-dark); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.post-body h3 { margin-bottom: 0.4rem; }
.post-body p { font-size: 0.92rem; margin-bottom: 0; }
.empty-state { text-align: center; padding: var(--space-5) 0; color: var(--muted-dark); font-family: var(--font-mono); }

/* Post reader overlay */
.post-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,31,61,0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-4) var(--space-2);
  overflow-y: auto;
}
.post-overlay.open { display: flex; }
.post-reader {
  background: var(--paper);
  max-width: 760px;
  width: 100%;
  border-radius: var(--radius);
  padding: var(--space-4);
  position: relative;
  margin-top: var(--space-3);
}
.post-close {
  position: absolute;
  top: var(--space-2); right: var(--space-2);
  background: var(--ink); color: var(--text-light);
  border: none; border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1.1rem; cursor: pointer;
}
.post-reader-body { line-height: 1.75; }
.post-reader-body p { color: var(--text-dark); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--muted-light); padding: var(--space-5) 0 var(--space-3); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-4); }
.footer-grid h4 { color: var(--text-light); font-size: 0.95rem; margin-bottom: var(--space-2); }
.footer-grid ul li { margin-bottom: 0.55rem; }
.footer-grid a:hover { color: var(--cyan); }
.footer-bottom {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(44,90,153,0.5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Page header (inner pages) ---------- */
.page-header { padding: var(--space-5) 0 var(--space-4); }
.page-header .eyebrow { margin-bottom: 0.7rem; }
.breadcrumb { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted-light); margin-bottom: var(--space-2); }
.breadcrumb a:hover { color: var(--cyan); }

/* ---------- Misc ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--copper); color: #1a0f00;
  padding: 0.6rem 1rem; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
