/* ============================================================
   COGNEXYS — Design System v2 (2B Arc-Text Corona)
   Canvas: #08090f  Accent: #7eb8d4 (ice-blue)
   Type: Newsreader · Satoshi · IBM Plex Mono
   ============================================================ */
:root {
  --canvas:   #08090f;
  --surface:  #0e1118;
  --panel:    #161d28;
  --border:   rgba(255,255,255,.07);
  --border-s: rgba(255,255,255,.13);
  --accent:   #7eb8d4;
  --accent-d: #4a8fad;
  --ink:      #d8e8f0;
  --muted:    rgba(216,232,240,.5);
  --faint:    rgba(216,232,240,.28);
  --serif:   'Newsreader', Georgia, serif;
  --sans:    'Satoshi', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;
  --ease:    cubic-bezier(.16,1,.3,1);
  --maxw:    1240px;
}
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box }
html { scroll-behavior:smooth }
body {
  font-family: var(--sans);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--canvas) }
a { color: inherit; text-decoration: none }
img { display: block; max-width: 100% }
.wrap        { max-width: var(--maxw); margin: 0 auto; padding: 0 40px }
.wrap-narrow { max-width: 860px;       margin: 0 auto; padding: 0 40px }

/* ── Typography ── */
h1,h2,h3,h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -.018em; line-height: 1.08 }
.display { font-size: clamp(2.6rem,6vw,4.8rem); line-height: 1.02; letter-spacing: -.025em }
.display em { font-style: italic; color: var(--accent) }
.h2  { font-size: clamp(1.9rem,3.5vw,2.9rem) }
.h2 em { font-style: italic; color: var(--accent) }
.h3  { font-size: 1.4rem }
.lede { font-size: clamp(1rem,1.4vw,1.16rem); color: var(--muted); line-height: 1.7 }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content:''; width:20px; height:.5px; background:var(--accent); display:block }
.mono { font-family: var(--mono) }
.muted { color: var(--muted) }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: .82rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 12px 26px; border: none; cursor: pointer;
  transition: .3s var(--ease);
}
.btn .arr { transition: transform .3s var(--ease) }
.btn:hover .arr { transform: translateX(4px) }
.btn-primary { background: var(--accent); color: var(--canvas) }
.btn-primary:hover { background: #9acce0; transform: translateY(-1px) }
.btn-outline { background: transparent; color: var(--ink); border: .5px solid var(--border-s) }
.btn-outline:hover { border-color: var(--accent); color: var(--accent) }
.btn-ghost { background: transparent; color: var(--accent); border: .5px solid rgba(126,184,212,.3) }
.btn-ghost:hover { background: rgba(126,184,212,.08) }

/* ── Nav ── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  transition: .4s var(--ease);
}
.site-nav.scrolled {
  background: rgba(8,9,15,.82);
  backdrop-filter: blur(18px);
  border-bottom: .5px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 40px; transition: padding .4s var(--ease);
}
.site-nav.scrolled .nav-inner { padding: 14px 40px }
.brand {
  font-family: var(--sans); font-size: .82rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); display: flex; align-items: center; gap: 9px;
}
.brand-mark { flex-shrink: 0 }
.nav-menu { display: flex; align-items: center; gap: 32px }
.nav-menu a {
  font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); transition: .25s; position: relative;
}
.nav-menu a:hover, .nav-menu a.active { color: var(--ink) }
.nav-menu a.active::after {
  content: ''; position: absolute; left: 0; bottom: -5px;
  width: 100%; height: .5px; background: var(--accent);
}
.nav-menu .btn { padding: 8px 18px; font-size: .72rem }
.nav-burger {
  display: none; background: none; border: none;
  cursor: pointer; flex-direction: column; gap: 5px; padding: 6px;
}
.nav-burger span { width: 20px; height: .5px; background: var(--ink); display: block; transition: .3s }
.nav-burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg) }
.nav-burger.open span:nth-child(2) { opacity: 0 }
.nav-burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg) }

/* ── Services dropdown ── */
.nav-has-drop { position: relative }
.nav-has-drop > .nav-drop-trigger {
  display: flex; align-items: center; gap: 5px;
  font-size: .75rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); transition: .25s; cursor: pointer;
  background: none; border: none; font-family: var(--sans);
  padding: 0; white-space: nowrap;
}
.nav-has-drop > .nav-drop-trigger:hover { color: var(--ink) }
.nav-has-drop > .nav-drop-trigger.active { color: var(--ink) }
.nav-has-drop > .nav-drop-trigger.active::after {
  content: ''; position: absolute; left: 0; bottom: -5px;
  width: 100%; height: .5px; background: var(--accent);
}
.drop-chevron {
  width: 8px; height: 8px; flex-shrink: 0;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .25s var(--ease);
  display: inline-block;
}
.nav-has-drop.open .drop-chevron { transform: rotate(-135deg) translateY(2px) }

.nav-dropdown {
  position: absolute; top: calc(100% + 18px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 2000; min-width: 560px;
  background: var(--surface);
  border: .5px solid var(--border-s);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.nav-has-drop.open .nav-dropdown {
  opacity: 1; pointer-events: all;
  transform: translateX(-50%) translateY(0);
}
.nav-drop-header {
  padding: 16px 20px 12px;
  border-bottom: .5px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.nav-drop-header span {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent);
}
.nav-drop-header a {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  color: var(--faint); transition: .2s; text-transform: uppercase;
}
.nav-drop-header a:hover { color: var(--accent) }
.nav-drop-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0;
}
.nav-drop-item {
  display: flex; gap: 14px; align-items: baseline;
  padding: 14px 20px; border-bottom: .5px solid var(--border);
  border-right: .5px solid var(--border);
  transition: background .2s;
  text-decoration: none;
}
.nav-drop-item:nth-child(2n) { border-right: none }
.nav-drop-item:nth-last-child(-n+2) { border-bottom: none }
.nav-drop-item:hover { background: rgba(126,184,212,.05) }
.nav-drop-item:hover .ddi-title { color: var(--ink) }
.nav-drop-item:hover .ddi-arr { opacity: 1 }
.ddi-num {
  font-family: var(--mono); font-size: .65rem; color: var(--accent);
  letter-spacing: .1em; flex-shrink: 0; margin-top: 2px;
}
.ddi-body { flex: 1 }
.ddi-title {
  font-size: .88rem; color: var(--muted);
  transition: color .2s; display: block; line-height: 1.3;
}
.ddi-sub {
  font-size: .72rem; font-family: var(--mono);
  color: var(--faint); margin-top: 3px; letter-spacing: .04em;
}
.ddi-arr {
  font-size: .8rem; color: var(--accent);
  opacity: 0; transition: opacity .2s; flex-shrink: 0;
}

/* mobile dropdown — flat list inside menu */
.nav-mobile-drop { display: none }
.nav-mobile-drop.open { display: flex; flex-direction: column; gap: 0 }
.nav-mobile-drop a {
  font-size: .9rem !important; letter-spacing: .06em !important;
  color: var(--faint) !important; padding: 10px 0 10px 20px;
  border-left: 1px solid var(--border); margin-left: 8px;
  text-transform: none !important;
}
.nav-mobile-drop a:hover { color: var(--accent) !important }

/* ── Section shells ── */
section { padding: 120px 0; position: relative }
.section-sm { padding: 80px 0 }
.page-hero { padding: 160px 0 80px; border-bottom: .5px solid var(--border) }
.sec-head { max-width: 700px; margin-bottom: 64px }
.sec-head .h2 { margin: 16px 0 18px }

/* ── Reveal animation ── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: .85s var(--ease);
}
.reveal.in { opacity: 1; transform: none }
.reveal-left { opacity:0; transform:translateX(-20px); transition:.85s var(--ease) }
.reveal-left.in { opacity:1; transform:none }
.reveal-right { opacity:0; transform:translateX(20px); transition:.85s var(--ease) }
.reveal-right.in { opacity:1; transform:none }

/* ── Hairline dividers ── */
.rule { border: none; border-top: .5px solid var(--border); margin: 0 }
.rule-v { width: .5px; background: var(--border); align-self: stretch }

/* ── Service grid ── */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  border: .5px solid var(--border);
}
.svc-tile {
  padding: 36px 32px; border-right: .5px solid var(--border);
  border-bottom: .5px solid var(--border);
  display: flex; flex-direction: column;
  transition: background .35s var(--ease), border-color .35s;
  position: relative; overflow: hidden;
}
.svc-tile:nth-child(3n) { border-right: none }
.svc-tile:hover { background: rgba(126,184,212,.05); border-color: rgba(126,184,212,.2) }
.svc-tile::after {
  content: ''; position: absolute; left: 0; top: 0;
  width: 0; height: .5px; background: var(--accent);
  transition: width .5s var(--ease);
}
.svc-tile:hover::after { width: 100% }
.tile-num { font-family: var(--mono); font-size: .72rem; color: var(--accent); letter-spacing: .1em; margin-bottom: 16px }
.tile-title { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); margin-bottom: 10px; font-weight: 400 }
.tile-sub { font-size: .9rem; color: var(--muted); line-height: 1.6; flex: 1 }
.tile-go { margin-top: 20px; font-family: var(--mono); font-size: .72rem; color: var(--accent); letter-spacing: .08em; display: inline-flex; align-items: center; gap: 7px; opacity: 0; transition: opacity .3s }
.svc-tile:hover .tile-go { opacity: 1 }

/* ── Feature layout ── */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start }
.feature.flip .feature-visual { order: -1 }

/* ── Capability list ── */
.cap-group { margin-bottom: 40px }
.cap-group-name {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: .5px solid var(--border);
}
.cap-list { list-style: none }
.cap-list li {
  display: flex; align-items: baseline; gap: 12px;
  padding: 11px 0; border-bottom: .5px solid var(--border);
  font-size: .97rem; color: var(--muted); transition: color .25s;
}
.cap-list li:hover { color: var(--ink) }
.cap-list li:last-child { border-bottom: none }
.cap-ix { font-family: var(--mono); font-size: .7rem; color: var(--accent); opacity: .6; flex-shrink: 0 }

/* ── Stat strip ── */
.stat-strip { display: grid; grid-template-columns: repeat(4,1fr); border: .5px solid var(--border) }
.stat-cell { padding: 32px 28px; border-right: .5px solid var(--border) }
.stat-cell:last-child { border-right: none }
.stat-n { font-family: var(--serif); font-size: 2.4rem; color: var(--accent); line-height: 1 }
.stat-l { font-size: .78rem; color: var(--faint); margin-top: 8px; letter-spacing: .08em; text-transform: uppercase; font-family: var(--mono) }

/* ── Quote band ── */
.band { background: var(--surface); border-top: .5px solid var(--border); border-bottom: .5px solid var(--border) }
.band-quote { font-family: var(--serif); font-size: clamp(1.5rem,3vw,2.4rem); line-height: 1.3; font-weight: 400; max-width: 26ch; color: var(--ink) }
.band-quote em { font-style: italic; color: var(--accent) }

/* ── Approach steps ── */
.steps { display: grid; grid-template-columns: repeat(4,1fr) }
.step { padding: 32px 28px 0 0; border-top: .5px solid var(--border); position: relative }
.step::before {
  content: ''; position: absolute; top: -.5px; left: 0;
  width: 0; height: 1px; background: var(--accent);
  transition: width .9s var(--ease);
}
.step.in::before { width: 60% }
.step-n { font-family: var(--mono); font-size: .7rem; color: var(--accent); letter-spacing: .12em; margin-bottom: 22px }
.step h4 { font-family: var(--serif); font-size: 1.35rem; margin-bottom: 10px; font-weight: 400 }
.step p { font-size: .9rem; color: var(--muted) }

/* ── Industries ── */
.ind-row { display: flex; flex-wrap: wrap; gap: 10px }
.ind-tag {
  border: .5px solid var(--border); padding: 10px 20px;
  font-size: .88rem; color: var(--muted); transition: .3s;
}
.ind-tag:hover { border-color: var(--accent); color: var(--accent) }

/* ── CTA card ── */
.cta-card {
  border: .5px solid var(--border-s); padding: 90px 60px;
  text-align: center; position: relative; overflow: hidden;
  background: var(--surface);
}
.cta-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 100%, rgba(126,184,212,.06), transparent);
}
.cta-card .h2 { max-width: 18ch; margin: 0 auto 18px }
.cta-card .lede { max-width: 46ch; margin: 0 auto 32px }

/* ── Breadcrumb ── */
.crumb { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; color: var(--faint); margin-bottom: 22px }
.crumb a:hover { color: var(--accent) }

/* ── Contact form ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px }
.field { margin-bottom: 20px }
.field label { display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px }
.field input, .field select, .field textarea {
  width: 100%; background: rgba(255,255,255,.03);
  border: .5px solid var(--border-s); padding: 13px 15px;
  font-family: var(--sans); font-size: .95rem;
  color: var(--ink); transition: .3s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  background: rgba(126,184,212,.03);
  box-shadow: 0 0 0 3px rgba(126,184,212,.08);
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint) }
.field textarea { resize: vertical; min-height: 120px }
.field select { appearance: none; cursor: pointer }
.field select option { background: var(--surface) }

/* ── Footer ── */
.site-footer { border-top: .5px solid var(--border); padding: 80px 0 36px }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 52px; border-bottom: .5px solid var(--border) }
.footer-about { margin-top: 18px; font-size: .9rem; color: var(--muted); line-height: 1.7; max-width: 30ch }
.footer-col h5 { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px }
.footer-col a { display: block; font-size: .88rem; color: var(--muted); margin-bottom: 11px; transition: .25s }
.footer-col a:hover { color: var(--ink) }
.footer-bot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding-top: 28px; font-family: var(--mono); font-size: .7rem; color: var(--faint); letter-spacing: .04em }

/* ── Trace diagram (service pages) ── */
.trace-wrap { position: relative; border: .5px solid var(--border); padding: 32px; background: var(--surface) }
.trace-label { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px }
canvas.trace { display: block; width: 100%; height: 160px }

/* ── Page nav (prev/next) ── */
.page-nav { display: grid; grid-template-columns: 1fr 1fr; border: .5px solid var(--border) }
.page-nav-item { padding: 28px 32px; transition: background .3s }
.page-nav-item:hover { background: rgba(126,184,212,.04) }
.page-nav-item + .page-nav-item { border-left: .5px solid var(--border) }
.pn-dir { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px }
.pn-title { font-family: var(--serif); font-size: 1.2rem; color: var(--ink) }

/* ── Responsive ── */
.grid-3-auto { display:grid; grid-template-columns: repeat(3,1fr) }
@media (max-width: 1020px) {
  .grid-3-auto { grid-template-columns: 1fr 1fr }
  .footer-grid { grid-template-columns: 1fr 1fr }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 40px }
  .feature.flip .feature-visual { order: 0 }
  .svc-grid { grid-template-columns: 1fr 1fr }
  .svc-tile:nth-child(3n) { border-right: .5px solid var(--border) }
  .svc-tile:nth-child(2n) { border-right: none }
  .stat-strip { grid-template-columns: 1fr 1fr }
  .stat-cell:nth-child(2) { border-right: none }
  .steps { grid-template-columns: 1fr 1fr }
}
@media (max-width: 680px) {
  .grid-3-auto { grid-template-columns: 1fr }
  .wrap, .wrap-narrow { padding: 0 22px }
  body { font-size: 15px }
  section { padding: 80px 0 }
  .page-hero { padding: 130px 0 60px }
  .nav-inner { padding: 16px 22px }
  .nav-menu {
    position: fixed; inset: 0; background: var(--canvas);
    flex-direction: column; justify-content: center; gap: 28px;
    transform: translateX(100%); transition: .45s var(--ease); z-index: 999;
  }
  .nav-menu.open { transform: none }
  .nav-menu a { font-size: 1.2rem }
  .nav-burger { display: flex; z-index: 1001 }
  .svc-grid, .stat-strip, .steps { grid-template-columns: 1fr }
  .svc-tile:nth-child(n) { border-right: none }
  .stat-cell { border-right: none; border-bottom: .5px solid var(--border) }
  .form-grid { grid-template-columns: 1fr }
  .cta-card { padding: 60px 28px }
  .footer-grid { grid-template-columns: 1fr }
  .page-nav { grid-template-columns: 1fr }
  .page-nav-item + .page-nav-item { border-left: none; border-top: .5px solid var(--border) }
}
</style>
