/* ──────────────────────────────────────────────────────────────────
   Zib Digital — base.css
   Shared design system: tokens, reset, header, nav, footer, reveals.
   Page-specific styles stay inline in each .html file.
   ────────────────────────────────────────────────────────────────── */

:root {
  --bg: #FFFFFF;
  --paper: #FAFAF8;
  --ink: #000000;
  --ink-2: #0F0F0F;
  --ink-3: #1A1A1A;
  --muted: #6B6B6B;
  --muted-2: #9C9C9C;
  --rule: #E8E5DD;
  --rule-2: #D4D0C4;
  --accent: #FF6200;
  --accent-tint: #FFE8D9;
  --score-good: #0BAB6E;
  --score-mid:  #FF9D00;
  --score-bad:  #E03A3A;
  --dim: #F5F2EB;

  --display: "neue-haas-grotesk-display", "Helvetica Neue", Helvetica, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --body:    "neue-haas-grotesk-display", "Helvetica Neue", Helvetica, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --max: 1320px;
  --pad: clamp(20px, 4vw, 56px);
  --section-y: clamp(112px, 16vh, 220px);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Reset ───────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "kern", "liga", "ss01";
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
em { font-style: italic; font-weight: 400; }

/* ─── Utilities ────────────────────────────────────────────────── */
.container { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }
.tabular { font-variant-numeric: tabular-nums; }
.italic { font-style: italic; color: var(--accent); font-weight: 400; }
h1, h2, h3, .hero-h, .fork-h, .path-title, .moat-h, .cta-title { text-wrap: balance; }

/* ─── Site header / nav ──────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(255,255,255,0.78);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 0.5px solid transparent;
  transition: border-color 320ms var(--ease), background 320ms var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--rule); background: rgba(255,255,255,0.92); }
.site-header .row { display: flex; align-items: center; justify-content: space-between; height: 68px; position: relative; }
.brand { display: inline-flex; align-items: baseline; }
.brand img { height: 28px; width: auto; }
.nav { display: flex; gap: clamp(14px, 2vw, 28px); align-items: center; font-family: var(--display); font-size: 14px; }
.nav a { color: var(--ink); opacity: 0.72; transition: opacity 200ms var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }

/* ─── Nav dropdown (Locations) ────────────────────────────────── */
.nav-group { position: relative; }
.nav-group-toggle {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0.72;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 200ms var(--ease);
}
.nav-group-toggle:hover,
.nav-group-toggle[aria-expanded="true"],
.nav-group.has-current .nav-group-toggle { opacity: 1; }
.nav-group-toggle .chev {
  transition: transform 240ms var(--ease);
  opacity: 0.72;
}
.nav-group-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-group-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translate(-50%, 6px);
  background: #fff;
  border: 0.5px solid var(--rule);
  border-radius: 14px;
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 24px 60px -28px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.04);
  display: grid;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
  z-index: 60;
}
.nav-group.is-open .nav-group-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.nav-group-menu::before {
  content: "";
  position: absolute;
  inset: -14px 0 auto 0;
  height: 14px;
}
.nav-group-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  opacity: 0.78;
  transition: background 180ms var(--ease), opacity 180ms var(--ease);
}
.nav-group-menu a:hover,
.nav-group-menu a[aria-current="page"] {
  background: var(--paper);
  opacity: 1;
}
.nav-group-menu a[aria-current="page"] { color: var(--accent); }

/* ─── Mega menu (Services + Locations) ────────────────────────── */
/* Panel anchors to the header row so it can be wide + centred. */
.nav-group--mega { position: static; }
.nav-group--mega > .nav-group-menu {
  left: 50%;
  right: auto;
  transform: translate(-50%, 6px);
  width: min(940px, 94vw);
  padding: 28px 28px 24px;
  gap: 4px 28px;
}
.nav-group--mega.is-open > .nav-group-menu { transform: translate(-50%, 0); }
.nav-group-menu.mega-cities { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mega-col { display: flex; flex-direction: column; gap: 1px; align-items: stretch; }
.mega-h {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); padding: 2px 14px 8px;
}
.nav-group--mega .nav-group-menu a { padding: 8px 14px; opacity: 0.78; }
.mega-city { font-weight: 500; opacity: 1 !important; }
.mega-cities .mega-col { margin-bottom: 12px; }
.mega-cities .mega-col a:not(.mega-city) { font-size: 13px; color: var(--muted); padding: 5px 14px; }

/* Services — richer panel: service list + descriptions, with a promo panel */
.nav-group-menu.mega-services { grid-template-columns: 1.55fr 1fr; gap: 24px; width: min(820px, 94vw); }
.mega-services-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; align-content: start; }
.nav-group-menu.mega-services a.mega-svc {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 14px; border-radius: 10px; opacity: 1;
}
.mega-svc:hover { background: var(--paper); }
.mega-svc-name { font-weight: 500; font-size: 15px; color: var(--ink); }
.mega-svc-desc { font-size: 12.5px; line-height: 1.42; color: var(--muted); }
.mega-promo {
  background: var(--ink); color: #fff; border-radius: 14px; padding: 22px;
  display: flex; flex-direction: column; gap: 14px; justify-content: center;
}
.mega-promo-eyebrow { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.nav-group-menu.mega-services a.mega-promo-cta {
  background: var(--accent); color: #fff; opacity: 1; font-weight: 500; font-size: 14px;
  padding: 12px 16px; border-radius: 999px; text-align: center;
  transition: transform 180ms var(--ease);
}
.mega-promo-cta:hover { transform: translateY(-1px); }
.nav-group-menu.mega-services a.mega-promo-reviews {
  color: rgba(255,255,255,0.82); opacity: 1; font-size: 13px; padding: 0;
}
.nav-group-menu.mega-services a.mega-promo-reviews:hover { color: #fff; background: rgba(255,255,255,0.08); }
.mega-promo-reviews .stars { color: var(--accent); letter-spacing: 1px; }
.mega-promo-reviews strong { color: #fff; }

/* Header end region — holds the persistent CTA + the burger toggle.
   CTA stays visible at every viewport; burger only appears below 880px. */
.nav-end {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 16px);
}
.nav-end .cta, .nav a.cta {
  background: var(--ink);
  color: #fff;
  opacity: 1;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 500;
  transition: transform 200ms var(--ease);
}
.nav-end .cta:hover, .nav a.cta:hover { transform: translateY(-1px); }
.nav-end .nav-ghost {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--rule-2);
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
  transition: border-color 200ms var(--ease), transform 200ms var(--ease);
}
.nav-end .nav-ghost:hover { border-color: var(--ink); transform: translateY(-1px); }
@media (max-width: 860px) { .nav-end .nav-ghost { display: none; } }

/* Burger toggle — 3 animated bars that morph into an × when open */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  position: relative;
}
.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 1.5px;
  margin: 5px auto;
  background: var(--ink);
  border-radius: 1px;
  transform-origin: center;
  transition: transform 280ms var(--ease), opacity 200ms var(--ease);
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 880px) {
  /* Burger button visible · drawer becomes the nav */
  .nav-toggle { display: block; }
  .site-header { position: relative; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    padding: 4px 0;
    border-top: 0.5px solid var(--rule);
    box-shadow: 0 24px 40px -20px rgba(0,0,0,0.18);
    max-height: 0;
    overflow: hidden;
    transition: max-height 320ms var(--ease);
  }
  .nav.is-open { max-height: 80vh; overflow-y: auto; }
  .nav a {
    display: block;
    padding: 14px clamp(20px, 5vw, 28px);
    border-bottom: 0.5px solid var(--rule);
    font-size: 16px;
    opacity: 1;
  }
  .nav a:last-child { border-bottom: 0; }

  /* Mobile: nav dropdown becomes an inline collapsible group */
  .nav-group { width: 100%; border-bottom: 0.5px solid var(--rule); }
  .nav-group-toggle {
    width: 100%;
    padding: 14px clamp(20px, 5vw, 28px);
    justify-content: space-between;
    font-size: 16px;
    opacity: 1;
    text-align: left;
  }
  .nav-group-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    background: var(--paper);
    padding: 0;
    min-width: 0;
    opacity: 1;
    pointer-events: auto;
    display: none;
  }
  .nav-group.is-open > .nav-group-menu {
    display: block !important;
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    max-height: none !important;
    overflow: visible !important;
    pointer-events: auto !important;
  }
  .nav-group-menu::before { content: none; }
  .nav-group-menu a {
    border-radius: 0;
    border-bottom: 0.5px solid var(--rule);
    padding: 12px clamp(32px, 8vw, 44px);
    font-size: 15px;
  }
  .nav-group-menu a:last-child { border-bottom: 0; }
}
.header-spacer { height: 68px; }

/* ─── Mega menu · mobile (stacks inside the drawer) ───────────── */
@media (max-width: 880px) {
  .nav-group--mega { position: static; width: 100%; border-bottom: 0.5px solid var(--rule); }
  .nav-group--mega > .nav-group-menu {
    position: static; left: auto; right: auto; transform: none;
    width: auto; padding: 0; min-width: 0;
    grid-template-columns: 1fr;
    background: var(--paper);
    opacity: 1; pointer-events: auto;
    box-shadow: none; border: 0; border-radius: 0;
    display: none;
  }
  .nav-group--mega.is-open > .nav-group-menu { display: block; transform: none; }
  .nav-group-menu.mega-4, .nav-group-menu.mega-cities { grid-template-columns: 1fr; }
  .mega-h { padding: 14px clamp(32px,8vw,44px) 4px; }
  .nav-group--mega .nav-group-menu a { padding: 12px clamp(32px,8vw,44px); border-bottom: 0.5px solid var(--rule); }
  .mega-cities .mega-col { margin-bottom: 0; }
  .mega-cities .mega-col a:not(.mega-city) { padding: 10px clamp(40px,10vw,52px); font-size: 14px; color: var(--muted); }

  .nav-group-menu.mega-services { grid-template-columns: 1fr; width: auto; gap: 0; }
  .mega-services-list { grid-template-columns: 1fr; }
  .nav-group-menu.mega-services a.mega-svc { padding: 13px clamp(32px,8vw,44px); border-bottom: 0.5px solid var(--rule); }
  .mega-svc-desc { display: none; }
  .mega-promo { background: transparent; color: var(--ink); border-radius: 0; padding: 14px clamp(32px,8vw,44px) 20px; }
  .mega-promo-eyebrow { color: var(--muted); }
  .mega-promo-reviews { color: var(--muted) !important; }
  .mega-promo-reviews strong { color: var(--ink); }
}

/* ─── Buttons (shared) ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px; border-radius: 999px;
  font-family: var(--display); font-size: 15px; font-weight: 500;
  transition: transform 200ms var(--ease), background 200ms var(--ease), color 200ms var(--ease);
}
.btn .arr { transition: transform 200ms var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { transform: translateY(-1px); }

/* ─── Footer ──────────────────────────────────────────────────── */
/* Default footer styles. Pages can override (e.g. dark theme) by
   defining matching selectors in their own inline <style> block —
   inline rules come after this stylesheet, so they win on ties. */
footer {
  border-top: 0.5px solid var(--rule);
  padding-top: clamp(56px, 7vw, 88px);
  padding-bottom: 28px;
}
/* Scoped under `footer` so these win on specificity over any page's legacy
   inline `.foot-grid` rules (which load after base.css). */
footer .foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 2.7fr;
  gap: clamp(40px, 5vw, 88px);
  padding-bottom: clamp(56px, 7vw, 88px);
  margin-bottom: 0;
}
/* The four link groups live in their own sub-grid so the brand block's
   height (address + partner logos) can never push a column onto a new row. */
footer .foot-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 3vw, 40px);
}
@media (max-width: 1080px) {
  footer .foot-grid { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 720px) {
  footer .foot-links { grid-template-columns: 1fr 1fr; gap: 36px 24px; }
}
@media (max-width: 480px) {
  footer .foot-links { grid-template-columns: 1fr; }
}
.foot-grid h4 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 20px;
}
/* Stacked groups within one column (e.g. Services + AI services) */
.foot-grid ul + h4 { margin-top: 32px; }
.foot-grid ul { list-style: none; display: grid; gap: 10px; padding: 0; margin: 0; }
.foot-grid li { font-size: 15px; color: var(--ink-3); }
.foot-grid a { font-size: 15px; color: var(--ink-3); transition: color 200ms var(--ease); }
.foot-grid a:hover { color: var(--accent); }
.foot-tag {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: -0.025em;
  line-height: 1.2;
  max-width: 28ch;
  margin-top: 24px;
}
.foot-address {
  font-style: normal;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.foot-partners {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.foot-partner {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
}
.foot-partner img { display: block; }
.foot-bar a { color: inherit; border-bottom: 1px solid transparent; transition: border-color 200ms var(--ease); }
.foot-bar a:hover { border-bottom-color: currentColor; }
.foot-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 0.5px solid var(--rule);
  color: var(--muted);
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.foot-clock {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
@keyframes fpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.foot-clock .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: var(--score-good);
  animation: fpulse 2s ease-in-out infinite;
}

/* ─── Reveals ─────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(6px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease), filter 800ms var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); filter: blur(0); }
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(6px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease), filter 700ms var(--ease);
}
.reveal-stagger.in > * { opacity: 1; transform: translateY(0); filter: blur(0); }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 300ms; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 400ms; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 500ms; }
.reveal-stagger.in > *:nth-child(7) { transition-delay: 600ms; }
.reveal-stagger.in > *:nth-child(8) { transition-delay: 700ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* Visually-hidden label utility (screen-reader only). Shared so audit/contact
   forms render as intended on every page, not just where it was inlined. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Persistent floating "Get in touch" CTA (shared via footer partial). */
.float-cta {
  position: fixed;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
  padding: 14px 22px;
  border-radius: 999px;
  box-shadow: 0 18px 44px -12px rgba(255,98,0,0.55), 0 4px 14px rgba(0,0,0,0.18);
  transition: transform 200ms var(--ease), background 200ms var(--ease);
}
.float-cta:hover { background: #ff7a24; transform: translateY(-2px); }
.float-cta svg { flex-shrink: 0; }
@media (max-width: 600px) { .float-cta { padding: 13px 18px; font-size: 14px; gap: 8px; } }
@media print { .float-cta { display: none; } }

/* Skip link — visually hidden until keyboard-focused. */
.skip-link {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  transform: translateY(-200%);
  transition: transform 240ms var(--ease);
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Numbered category cards · shared component ──────────────────────
   Reusable "01 · Label / Title / desc" card grid (originated on /google-ads).
   Add a .feat-grid with .feat-card children (.feat-num, .feat-name, .feat-desc). */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2vw, 24px);
}
@media (max-width: 1080px) { .feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feat-grid { grid-template-columns: 1fr; } }
.feat-card {
  display: block;
  padding: clamp(28px, 3vw, 36px);
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: #fff;
  transition: transform 280ms var(--ease), border-color 280ms var(--ease), box-shadow 280ms var(--ease);
}
a.feat-card { text-decoration: none; color: inherit; }
.feat-card:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 30px 80px -40px rgba(0,0,0,0.18); }
.feat-num { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--muted-2); font-weight: 600; }
.feat-name { font-family: var(--display); font-size: clamp(22px, 2vw, 28px); font-weight: 500; letter-spacing: -0.02em; margin-top: 12px; }
.feat-desc { color: var(--muted); font-size: 15px; line-height: 1.55; margin-top: 14px; }
