/* ==========================================================================
   Aptus Logic — site styles
   ========================================================================== */

:root {
  --steel: #3484A3;
  --steel-light: #4a9ec0;
  --steel-dim: #1f5f7a;
  --steel-tint: rgba(52, 132, 163, 0.1);
  --charcoal: #434545;
  --slate: #6D7376;

  --bg: #ffffff;
  --bg-subtle: #F4F6F7;
  --bg-card: #ffffff;
  --border: #DDE3E6;
  --fg: #434545;
  --fg-strong: #2b2d2d;
  --fg-muted: #6D7376;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --danger: #b4443a;

  --radius: 10px;
  --max: 1100px;
  --gutter: max(24px, env(safe-area-inset-left, 0px));
  --nav-h: 68px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1618;
    --bg-subtle: #161e21;
    --bg-card: #1a2428;
    --border: #263033;
    --fg: #e8ecee;
    --fg-strong: #ffffff;
    --fg-muted: #8fa3ab;
    --nav-bg: rgba(15, 22, 24, 0.92);
    --danger: #e0786e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1618;
  --bg-subtle: #161e21;
  --bg-card: #1a2428;
  --border: #263033;
  --fg: #e8ecee;
  --fg-strong: #ffffff;
  --fg-muted: #8fa3ab;
  --nav-bg: rgba(15, 22, 24, 0.92);
  --danger: #e0786e;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: 'Space Grotesk', system-ui, sans-serif; color: var(--fg-strong); }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--steel); color: #fff; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 200;
  background: var(--steel); color: #fff; padding: 10px 16px; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.container { max-width: var(--max); margin: 0 auto; }

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; letter-spacing: 0.06em; font-size: 20px; line-height: 1;
  color: var(--fg-strong);
}
.wordmark img { height: 34px; width: auto; }
.wordmark-logic { color: var(--steel); }

/* ---------- Nav ---------- */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
  padding-top: env(safe-area-inset-top, 0px);
}
.site-nav.is-scrolled { border-bottom-color: var(--border); box-shadow: 0 2px 20px rgba(0,0,0,.04); }
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--fg-muted); text-decoration: none;
  transition: color .2s; position: relative; padding: 4px 0;
}
.nav-links a:not(.nav-cta):hover,
.nav-links a[aria-current="true"] { color: var(--steel); }
.nav-links a[aria-current="true"]:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--steel); border-radius: 2px;
}
.nav-cta {
  background: var(--steel); color: #fff !important;
  padding: 9px 20px !important; border-radius: 7px; transition: background .2s;
}
.nav-cta:hover { background: var(--steel-dim); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; margin-right: -10px; border-radius: 8px; color: var(--fg-strong);
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px;
  margin: 0 auto; position: relative; transition: transform .25s, background .2s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px var(--gutter) 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,.08);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility 0s .2s;
  }
  .nav-links.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .2s; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: 0; padding-top: 16px; }
  .nav-links a { display: block; padding: 14px 0; font-size: 16px; }
  .nav-links a[aria-current="true"]::after { display: none; }
  .nav-cta { text-align: center; padding: 13px 20px !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 7px; font: 600 15px/1.2 'Inter', sans-serif;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--steel); color: #fff; }
.btn-primary:hover { background: var(--steel-dim); }
.btn-secondary { color: var(--fg-strong); border-color: var(--border); font-weight: 500; }
.btn-secondary:hover { border-color: var(--steel); color: var(--steel); }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: calc(var(--nav-h) + 96px) var(--gutter) 104px;
}
.hero::before {
  /* subtle engineered grid */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 85% 20%, #000 0%, transparent 70%);
  opacity: .7;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--steel); margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--steel); }
.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 3.9rem); font-weight: 700; line-height: 1.08;
  letter-spacing: -0.025em; max-width: 800px; text-wrap: balance; margin-bottom: 26px;
}
.hero h1 em { font-style: normal; color: var(--steel); }
.hero-lede { font-size: 1.15rem; color: var(--fg-muted); max-width: 590px; line-height: 1.7; margin-bottom: 40px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 64px; padding-top: 28px;
  border-top: 1px solid var(--border); list-style: none;
}
.hero-facts li { font-size: 14px; color: var(--fg-muted); display: flex; align-items: center; gap: 10px; }
.hero-facts svg { width: 18px; height: 18px; stroke: var(--steel); fill: none; stroke-width: 2; flex-shrink: 0; }

/* ---------- Sections ---------- */
.section { padding: 100px var(--gutter); }
.section-alt { background: var(--bg-subtle); }
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--steel); margin-bottom: 14px;
}
.section-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.15; margin-bottom: 16px; text-wrap: balance;
}
.section-sub { font-size: 1.05rem; color: var(--fg-muted); max-width: 580px; line-height: 1.7; margin-bottom: 56px; }

/* ---------- Services ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.card:hover { border-color: var(--steel); box-shadow: 0 8px 30px rgba(52,132,163,.1); transform: translateY(-2px); }
.card-icon {
  width: 46px; height: 46px; border-radius: 10px; background: var(--steel-tint);
  display: grid; place-items: center; margin-bottom: 22px;
}
.card-icon svg { width: 22px; height: 22px; stroke: var(--steel); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 1.08rem; font-weight: 600; margin-bottom: 10px; }
.card p { font-size: .92rem; color: var(--fg-muted); line-height: 1.65; }

/* ---------- Process ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 40px 32px; counter-reset: step; list-style: none; }
.step { counter-increment: step; position: relative; padding-top: 22px; border-top: 2px solid var(--border); }
.step::before {
  content: ""; position: absolute; top: -2px; left: 0; width: 40px; height: 2px; background: var(--steel);
}
.step-num {
  font-family: 'Space Grotesk', sans-serif; font-size: 2.6rem; font-weight: 700; color: var(--steel);
  opacity: .3; line-height: 1; margin-bottom: 16px;
}
.step-num::before { content: counter(step, decimal-leading-zero); }
.step h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.step p { font-size: .9rem; color: var(--fg-muted); line-height: 1.65; }

/* ---------- Work ---------- */
.work-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.work-card::before { content: ""; height: 4px; background: linear-gradient(90deg, var(--steel), var(--steel-light)); }
.work-card-body { padding: 28px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--steel); background: var(--steel-tint); padding: 4px 11px; border-radius: 20px; margin-bottom: 14px;
}

/* ---------- About ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 48px; } }
.prose p:not(.section-label) { font-size: 1rem; color: var(--fg-muted); line-height: 1.75; margin-bottom: 20px; }
.prose p:not(.section-label):last-child { margin-bottom: 0; }
.industries { display: flex; flex-direction: column; gap: 12px; list-style: none; }
.industry {
  display: grid; grid-template-columns: 8px 170px 1fr; align-items: center; gap: 16px;
  padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  transition: border-color .2s;
}
.industry:hover { border-color: var(--steel); }
.industry::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--steel); }
.industry strong { font-family: 'Space Grotesk', sans-serif; font-size: .94rem; font-weight: 600; color: var(--fg-strong); }
.industry span { font-size: .84rem; color: var(--fg-muted); line-height: 1.45; }
@media (max-width: 520px) {
  .industry { grid-template-columns: 8px 1fr; gap: 4px 14px; }
  .industry span { grid-column: 2; }
}

/* ---------- CTA band ---------- */
.cta-band { background: var(--steel-dim); color: #fff; padding: 72px var(--gutter); }
.cta-band .container { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; font-size: clamp(1.5rem, 2.8vw, 2.1rem); letter-spacing: -0.02em; max-width: 620px; text-wrap: balance; }
.cta-band p { color: rgba(255,255,255,.8); margin-top: 10px; max-width: 560px; }
.cta-band .btn-primary { background: #fff; color: var(--steel-dim); }
.cta-band .btn-primary:hover { background: #eaf3f7; }

/* ---------- Contact ---------- */
.contact-lede { font-size: 1rem; color: var(--fg-muted); line-height: 1.7; margin-bottom: 32px; }
.contact-list { display: flex; flex-direction: column; gap: 18px; list-style: none; }
.contact-item { display: flex; gap: 14px; align-items: flex-start; }
.contact-item-icon {
  width: 38px; height: 38px; border-radius: 8px; background: var(--steel-tint);
  display: grid; place-items: center; flex-shrink: 0;
}
.contact-item-icon svg { width: 17px; height: 17px; stroke: var(--steel); fill: none; stroke-width: 2; }
.contact-item small {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-muted); margin-bottom: 2px;
}
.contact-item a, .contact-item p { font-size: .98rem; color: var(--fg-strong); text-decoration: none; font-weight: 500; }
.contact-item a:hover { color: var(--steel); }

.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
@media (max-width: 520px) { .form-card { padding: 22px; } }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--fg-muted); }
.field label .req { color: var(--steel); }
.field input, .field textarea, .field select {
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 7px;
  padding: 12px 14px; font: 15px 'Inter', sans-serif; color: var(--fg-strong);
  outline: none; transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field textarea { min-height: 140px; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236D7376' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 40px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--steel); box-shadow: 0 0 0 3px var(--steel-tint); }
.field input::placeholder, .field textarea::placeholder { color: var(--fg-muted); opacity: .7; }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.field-error { font-size: 12.5px; color: var(--danger); min-height: 0; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-footer { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-note { font-size: 12.5px; color: var(--fg-muted); }
.form-note a { color: var(--steel); }
.btn[disabled] { opacity: .65; cursor: progress; transform: none; }
.form-status { border-radius: 7px; padding: 14px 18px; font-size: 14px; display: none; }
.form-status.is-success { display: block; background: var(--steel-tint); border: 1px solid rgba(52,132,163,.25); color: var(--steel); }
.form-status.is-error { display: block; background: rgba(180,68,58,.08); border: 1px solid rgba(180,68,58,.25); color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 48px var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px)); }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand p { font-size: 13px; color: var(--fg-muted); margin-top: 12px; max-width: 320px; }
.footer-links { display: flex; gap: 12px 28px; list-style: none; flex-wrap: wrap; }
.footer-links a { font-size: 14px; color: var(--fg-muted); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--steel); }
.footer-bottom {
  margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  font-size: 13px; color: var(--fg-muted);
}

/* ---------- Simple pages (privacy, 404) ---------- */
.page { padding: calc(var(--nav-h) + 72px) var(--gutter) 96px; }
.page .container { max-width: 760px; }
.page h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.02em; margin-bottom: 12px; }
.page h2 { font-size: 1.25rem; margin: 40px 0 12px; }
.page p, .page li { color: var(--fg-muted); line-height: 1.75; }
.page p + p { margin-top: 14px; }
.page ul { padding-left: 20px; margin-top: 10px; }
.page a { color: var(--steel); }
.page-meta { font-size: 14px; margin-bottom: 32px; }
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.notfound .code { font-family: 'Space Grotesk', sans-serif; font-size: clamp(5rem, 18vw, 9rem); font-weight: 700; color: var(--steel); opacity: .25; line-height: 1; }
.notfound p { margin: 12px auto 32px; max-width: 420px; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 600px) {
  .hero { padding-top: calc(var(--nav-h) + 56px); padding-bottom: 72px; }
  .hero-facts { margin-top: 48px; }
  .section { padding-top: 72px; padding-bottom: 72px; }
  .card { padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
