/* Metamach Solutions — base stylesheet
   Palette: deep navy + warm accent. No framework, no JS dependency for layout. */

:root {
  --navy-900: #0b1f3a;
  --navy-800: #102a4c;
  --navy-700: #18365e;
  --ink:      #18222f;
  --slate:    #475569;
  --muted:    #64748b;
  --line:     #e2e8f0;
  --bg:       #ffffff;
  --bg-alt:   #f6f8fb;
  --bg-deep:  #0b1f3a;
  --accent:   #c8924a;       /* warm bronze */
  --accent-2: #b87a2e;
  --focus:    #2563eb;

  --maxw: 1140px;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow:    0 6px 18px rgba(15, 23, 42, .08);
  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--accent-2); }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--navy-900);
  margin: 0 0 .5em;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { margin: 0 0 1em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy-900); color: #fff; padding: .5rem .75rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* Header / Nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--navy-900); font-weight: 700; }
.brand:hover { color: var(--navy-900); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--navy-900); color: var(--accent);
}
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-serif); font-size: 1.2rem; letter-spacing: -0.01em; }
.brand-suffix { font-size: .72rem; font-weight: 500; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }

.primary-nav ul { list-style: none; display: flex; gap: .25rem; padding: 0; margin: 0; }
.primary-nav a {
  display: inline-block; padding: .55rem .85rem; border-radius: 6px;
  color: var(--ink); font-weight: 500; font-size: .96rem;
}
.primary-nav a:hover { background: var(--bg-alt); color: var(--navy-900); }
.primary-nav a[aria-current="page"] {
  color: var(--navy-900);
  background: var(--bg-alt);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-toggle {
  display: none; background: transparent; border: 0; padding: .5rem;
  width: 44px; height: 44px; cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; width: 24px; background: var(--navy-900);
  margin: 5px auto; transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .primary-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .primary-nav.open { max-height: 480px; }
  .primary-nav ul { flex-direction: column; padding: .5rem 1rem 1rem; gap: 0; }
  .primary-nav a { display: block; padding: .8rem .5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .primary-nav a[aria-current="page"] { box-shadow: none; border-left: 3px solid var(--accent); padding-left: .9rem; }
}

/* Buttons */
.btn {
  display: inline-block; padding: .8rem 1.25rem; border-radius: 6px;
  font-weight: 600; font-size: .96rem; letter-spacing: .01em;
  border: 1px solid transparent; cursor: pointer; transition: transform .05s, background .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--navy-900); color: #fff; }
.btn--primary:hover { background: var(--navy-700); color: #fff; }
.btn--ghost { background: transparent; color: var(--navy-900); border-color: var(--navy-900); }
.btn--ghost:hover { background: var(--navy-900); color: #fff; }
.btn--accent { background: var(--accent); color: var(--navy-900); }
.btn--accent:hover { background: var(--accent-2); color: #fff; }
.btn:active { transform: translateY(1px); }

/* Hero */
.hero {
  background:
    radial-gradient(ellipse at 80% 0%, rgba(200,146,74,.18), transparent 55%),
    linear-gradient(180deg, #0b1f3a 0%, #102a4c 100%);
  color: #e8eef7;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3.5rem, 9vw, 7rem);
  position: relative; overflow: hidden;
}
.hero h1 { color: #fff; max-width: 22ch; }
.hero .lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: #cdd7e6; max-width: 60ch; margin-bottom: 1.75rem;
}
.hero .eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero .actions .btn--ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.hero .actions .btn--ghost:hover { background: #fff; color: var(--navy-900); }

/* Page header (interior pages) */
.page-head {
  background: linear-gradient(180deg, #0b1f3a 0%, #18365e 100%);
  color: #e8eef7; padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}
.page-head h1 { color: #fff; margin-bottom: .25em; }
.page-head .lead { color: #cdd7e6; max-width: 64ch; margin: 0; }
.page-head .crumbs {
  font-size: .85rem; color: #9bb0cb; margin-bottom: .75rem; letter-spacing: .04em;
}

/* Sections */
section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
section.alt { background: var(--bg-alt); }
.section-h {
  font-size: .82rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: .75rem;
}
.section-lead { max-width: 62ch; color: var(--slate); font-size: 1.05rem; }

/* Grids */
.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 820px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* Cards */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cbd5e1; }
.card h3 { margin-top: 0; }
.card .icon {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--bg-alt); color: var(--navy-900);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem;
}

/* Stats */
.stats { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr; } }
.stat { text-align: left; }
.stat .num {
  font-family: var(--font-serif); font-size: clamp(2rem, 4vw, 2.6rem);
  color: var(--navy-900); line-height: 1; font-weight: 700;
}
.stat .label { color: var(--muted); font-size: .95rem; margin-top: .35rem; }

/* Clients strip */
.clients-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem;
  align-items: center;
}
@media (max-width: 720px) { .clients-strip { grid-template-columns: repeat(2, 1fr); } }
.client-pill {
  border: 1px solid var(--line); border-radius: 999px;
  padding: .65rem 1rem; text-align: center;
  background: #fff; color: var(--navy-800); font-weight: 600; font-size: .95rem;
}

/* Cookie consent banner — fixed at bottom, centered on a column that
   max-widths to keep it readable on wide screens. Hidden via the HTML
   [hidden] attribute by default; JS unhides if no prior decision is in
   localStorage. Both buttons share the existing .btn / .btn--ghost /
   .btn--accent palette so the banner reads as part of the site, not a
   foreign overlay. */
/* The base rule sets display:flex, which would override the UA
   [hidden] { display:none }. Raise specificity of the hidden state
   with [hidden] so banner.hidden = true actually hides it. */
.cookie-banner[hidden] { display: none; }
.cookie-banner {
  position: fixed;
  bottom: 1rem; left: 1rem; right: 1rem;
  z-index: 9000;
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 1rem 1.25rem;
  box-shadow: 0 14px 38px -14px rgba(16, 42, 76, .25), 0 4px 12px rgba(0, 0, 0, .05);
  font-size: .9rem; line-height: 1.45;
}
.cookie-banner p {
  margin: 0;
  flex: 1 1 18rem;
  color: var(--ink);
}
.cookie-banner a {
  color: var(--navy-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-actions {
  display: inline-flex; gap: .5rem; flex-shrink: 0;
}
.cookie-actions .btn {
  padding: .55rem 1.1rem; font-size: .88rem;
}
@media (max-width: 520px) {
  .cookie-banner { bottom: .5rem; left: .5rem; right: .5rem; padding: .85rem 1rem; }
  .cookie-actions { width: 100%; justify-content: flex-end; }
}

/* Homepage "trusted by" logo strip (index.php). Lighter-weight treatment
   than the full cards on clients.php: no name/sector text, just the marks
   in a horizontal wrap. Same grayscale-default + color-on-hover pattern as
   the cards so the brand language across both pages is consistent.

   Well height (64px) and image cap (56px) are sized for the WORST case:
   vertically-stacked logos like Emerson (icon-above-wordmark) and SmartStop
   (icon + two-line wordmark) need that vertical room to render their text
   at a readable size. Horizontal logos are width-capped first (max-width:
   140px) so they stay similar in visual weight to the stacked ones — the
   stack lands at ~56px tall while a horizontal wordmark lands at ~32–40px
   tall, similar perceived footprint either way. */
.clients-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  /* Bigger row gap than column gap — stacked + horizontal logos in the
     same row need a touch of extra vertical breathing room. */
  gap: 2rem 2.75rem;
}
.client-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 64px;
}
.client-mini img {
  max-height: 56px;
  max-width: 140px;
  /* The explicit width:140px is a fallback for SVGs whose root <svg> tag
     lacks width/height attributes — without intrinsic dimensions, the
     <img> can collapse to 0 width inside the inline-flex parent. The
     max-* caps still win when the SVG has its own dimensions, so this
     line is harmless for properly-sized SVGs and bitmaps. */
  width: 140px; height: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: .6;
  transition: filter .25s ease, opacity .25s ease;
}
.client-mini:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

/* Client logo cards (clients.php). The hard problem with a logo grid is
   that source files have wildly different aspect ratios (square emblems,
   wide horizontal wordmarks, tall stacked marks). Letting each logo fill
   the well to its native max produces a visually unbalanced grid even
   when every card has the same outer dimensions.
   The fix below caps BOTH dimensions tightly inside a larger well: every
   logo gets roughly the same "footprint" regardless of native shape.
   Cards without a logo file (no longer used in practice) fall back to a
   styled wordmark — the .client-logo--wordmark variant. */
.client-grid {
  /* Slightly larger gap so logos breathe — 1.5rem column gap reads as
     "individual brands" rather than "a single noisy banner". */
  gap: 1.5rem;
}
.client-grid .client-card {
  text-align: center;
  padding: 1.75rem 1.1rem 1.4rem;
  display: flex; flex-direction: column; align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.client-grid .client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -12px rgba(16,42,76,.22);
  border-color: #cdd6e1;
}

/* The logo "well": fixed height on every card so name/sector rows line
   up across the grid even if some cards have logos of different intrinsic
   heights. Width is full-card so the logo can center horizontally. */
.client-logo {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  height: 72px;
  margin-bottom: 1.15rem;
}

/* The critical sizing constraints. max-height caps tall/square logos so
   they don't dominate; max-width caps ultra-wide horizontal wordmarks so
   they don't stretch edge-to-edge. The smaller dimension wins via
   object-fit:contain, which means every logo ends up at a similar
   perceived size regardless of native pixel dimensions. */
.client-logo img {
  max-height: 52px;
  max-width: 78%;
  width: auto; height: auto;
  object-fit: contain;
  /* Real logos use every color in the rainbow. Desaturating by default
     makes the grid read as a coherent unit; color comes back on hover so
     individual brands are still identifiable when you reach for one. */
  filter: grayscale(100%);
  opacity: .72;
  transition: filter .25s ease, opacity .25s ease;
}
.client-card:hover .client-logo img {
  filter: grayscale(0%);
  opacity: 1;
}

/* Wordmark fallback for cards without a logo file. Same outer well
   dimensions so the grid stays aligned. */
.client-logo--wordmark {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px dashed #d6dde6;
  border-radius: 6px;
  width: 78%;
}
.client-logo--wordmark span {
  font-family: var(--font-serif);
  font-size: 1.05rem; font-weight: 700;
  color: var(--navy-800); letter-spacing: -.01em;
  padding: 0 .65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-name {
  font-size: .98rem; margin: 0 0 .18em; line-height: 1.2;
  color: var(--navy-900);
}
.client-sector {
  color: var(--muted); margin: 0;
  font-size: .82rem; line-height: 1.4;
  max-width: 20ch;
  margin-left: auto; margin-right: auto;
}

/* People */
.person {
  display: grid; grid-template-columns: 110px 1fr; gap: 1.25rem; align-items: start;
  padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
@media (max-width: 560px) { .person { grid-template-columns: 1fr; } }
.person .avatar {
  width: 110px; height: 110px; border-radius: 50%;
  background: linear-gradient(135deg, #102a4c, #18365e);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 2rem; font-weight: 700;
}
.person h3 { margin-bottom: .15em; }
.person .role { color: var(--muted); margin-bottom: .75em; font-size: .95rem; }

/* Forms */
.form { display: grid; gap: 1rem; max-width: 640px; }
.form label { font-weight: 500; font-size: .95rem; color: var(--navy-900); display: block; margin-bottom: .35rem; }
.form input, .form textarea, .form select {
  width: 100%; padding: .7rem .85rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #cbd5e1; border-radius: 6px;
  transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: 0; border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(24,54,94,.15);
}
.form textarea { min-height: 160px; resize: vertical; }
.form .hp { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; overflow: hidden; }
.form-message {
  padding: .9rem 1rem; border-radius: 6px; font-weight: 500;
}
.form-message.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.form-message.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* CTA band */
.cta-band {
  background: linear-gradient(180deg, #102a4c 0%, #0b1f3a 100%); color: #fff;
}
.cta-band h2 { color: #fff; }
.cta-band .container {
  display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.cta-band p { color: #cdd7e6; max-width: 60ch; margin: 0; }

/* Footer */
.site-footer { background: #0a1a30; color: #cbd5e1; padding: 3rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-h {
  color: #fff; font-family: var(--font-sans); font-size: .85rem;
  font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 .75rem;
}
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer-list a { color: #cbd5e1; }
.footer-list a:hover { color: var(--accent); }
.footer-blurb { color: #95a3b8; max-width: 38ch; margin-top: .75rem; }
.brand--footer { color: #fff; cursor: default; }
.brand--footer:hover { color: #fff; } /* override global .brand:hover so text stays readable on dark footer */
.brand--footer .brand-mark { background: rgba(255,255,255,.06); }
.brand--footer .brand-suffix { color: #95a3b8; }
.footer-base {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1.25rem; margin-top: 2rem;
  font-size: .85rem; color: #95a3b8;
}

/* Misc */
.kicker { color: var(--accent-2); font-weight: 600; }
.divider { height: 1px; background: var(--line); margin: 2rem 0; border: 0; }
.list-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.list-checks li { padding-left: 1.75rem; position: relative; color: var(--slate); }
.list-checks li::before {
  content: ""; position: absolute; left: 0; top: .55rem;
  width: 14px; height: 8px; border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
