/* Fonts are loaded via <link> in the document head — an @import here would be
   discovered only after this stylesheet downloads, blocking the first paint. */

:root {
  --blue: #4169E1;
  --black: #000000;
  --white: #ffffff;
  --font-body: 'Roboto', sans-serif;
  --font-heading: 'Goldman', cursive;
  --nav-height: 72px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
}

/* ===== GLOBAL GRAIN TEXTURE ===== */
body::after {
  content: '';
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='512' height='512' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.032;
  pointer-events: none;
  z-index: 9999;
  animation: grain 8s steps(10) infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-2%, -3%); }
  20%  { transform: translate(3%, 1%); }
  30%  { transform: translate(-1%, 4%); }
  40%  { transform: translate(4%, -2%); }
  50%  { transform: translate(-3%, 3%); }
  60%  { transform: translate(2%, -4%); }
  70%  { transform: translate(-4%, 1%); }
  80%  { transform: translate(1%, 2%); }
  90%  { transform: translate(-2%, -1%); }
  100% { transform: translate(0, 0); }
}


/* ===== LAYOUT CONTAINER ===== */
/* Shared by page sections and the footer. It lives in the shell stylesheet
   (not home.css) so the shared chrome never depends on a page stylesheet. */
.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

/* Pages with no full-bleed hero set `navSolid: true` in front matter, which the
   build turns into <body data-nav-solid>. <main> then reserves the fixed bar's
   height and fills the viewport so the footer is not hidden under the bar.
   Pages with a hero (transparent bar over it) are untouched. */
body[data-nav-solid] .site-main {
  padding-top: var(--nav-height);
  min-height: 100vh;    /* fallback for browsers without svh */
  min-height: 100svh;   /* same reasoning as .hero: no jump when the mobile toolbar slides */
}
/* ===== DESIGN SYSTEM (shared) ===== */
/* Typography scale, buttons and the scroll-reveal primitive. Used by more than
   one page, so they live in the shell stylesheet with the navbar and footer
   rather than in a page stylesheet. */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--delay, 0s);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

.section-title {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 16px;
  line-height: 1.1;
  text-transform: uppercase;
}

.section-sub {
  font-size: 15px;
  color: #666;
  margin-bottom: 40px;
  max-width: 540px;
  line-height: 1.7;
}

.btn-primary {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
  background: var(--blue);
  padding: 13px 28px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.3px;
}
.btn-primary:hover { background: #2d55cc; transform: translateY(-1px); }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  /* transparent WHITE, not `transparent` (which is transparent black): fading
     black -> white interpolates through a grey haze, which is what made the
     scroll-back-to-top change look rough */
  background: rgba(255, 255, 255, 0);
  border-bottom: 1px solid rgba(255, 255, 255, 0);
  transition: background 0.45s ease, border-color 0.45s ease;
}

/* Smooth transitions on all child elements */
.navbar .nav-logo img      { transition: filter 0.45s ease; filter: brightness(0) invert(1); }
.navbar .nav-item > a      { transition: color 0.3s ease; color: rgba(255,255,255,0.88); }
.navbar .nav-item > a:hover { color: #fff; }
.navbar .nav-item.has-mega:hover > a .arrow { color: #fff; }
.navbar .nav-toggle span   { transition: background 0.3s ease; background: #fff; }
.navbar .nav-cta .btn-call {
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  background: transparent !important;
  color: #fff !important;
  border: 1.5px solid rgba(255,255,255,0.6) !important;
  text-transform: none;
}
.navbar .nav-cta .btn-call:hover { background: rgba(255,255,255,0.18) !important; transform: translateY(-1px); }

/* ── Solid state (nav-solid added by JS on scroll) ── */
.navbar.nav-solid { background: var(--white) !important; border-bottom-color: #ebebeb !important; }
.navbar.nav-solid .nav-logo img            { filter: none !important; }
.navbar.nav-solid .nav-item > a            { color: var(--black) !important; }
.navbar.nav-solid .nav-item > a:hover      { color: var(--blue) !important; }
.navbar.nav-solid .nav-item.has-mega:hover > a .arrow { color: var(--blue) !important; }
.navbar.nav-solid .nav-toggle span         { background: var(--black) !important; }
.navbar.nav-solid .nav-cta .btn-call {
  background: var(--blue) !important;
  color: var(--white) !important;
  /* keep the 1.5px border width (invisible against the blue) — `border: none`
     shrank the button 3px instantly, right as the nav colour changed */
  border: 1.5px solid var(--blue) !important;
}
.navbar.nav-solid .nav-cta .btn-call:hover { background: #2d55cc !important; }

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.nav-logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-logo img {
  height: 34px;
  width: auto;
}

/* Center Menu */
.nav-menu {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item > a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
  letter-spacing: 0.4px;
  word-spacing: 1px;
}

.nav-item > a:hover {
  color: var(--blue);
}

.nav-item > a .arrow {
  font-size: 9px;
  display: inline-block;
  transition: transform 0.2s;
}

/* Hover-driven affordances are desktop-only. At <=960px :hover still fires in a
   narrowed desktop browser and then fights the tap-driven .mega-open state. */
@media (min-width: 961px) {
  .nav-item.has-mega:hover > a .arrow {
    transform: rotate(180deg);
    color: var(--blue);
  }
}

/* ===== MEGA MENU ===== */
.nav-item.has-mega { position: static; }

.mega-menu {
  position: fixed;
  top: var(--nav-height);
  /* Constrained to nav-container width, centered */
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: calc(100% - 80px);
  max-width: 1320px;
  border-radius: 0 0 10px 10px;
  padding: 36px 40px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s,
              background 0.35s ease, border-color 0.35s ease;
  z-index: 999;
  /* ── Transparent state (default — navbar is over hero) ── */
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 2px solid rgba(255,255,255,0.15);
}

/* Desktop-only, and it must stay that way. Unscoped, this selector carries an
   extra :hover so it out-specifies the mobile reset, and its
   `translateX(-50%)` shoved the now-static mobile panel half its own width to
   the left — the "menu jumps left and shows nothing to click" bug. */
@media (min-width: 961px) {
  .nav-item.has-mega:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}

/* ── Mega menu: solid state ── */
.navbar.nav-solid .mega-menu {
  background: var(--white);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 2px solid var(--blue);
  border-bottom: 1px solid #ebebeb;
}

/* Transparent mega — white text */
.mega-col h4 {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.mega-col a {
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  padding: 7px 0;
  transition: color 0.2s, padding-left 0.2s;
}
.mega-col a:hover { color: #fff; padding-left: 6px; }

/* Solid mega — dark text */
.navbar.nav-solid .mega-col h4 {
  color: var(--blue);
  border-bottom-color: #ebebeb;
}
.navbar.nav-solid .mega-col a { color: #333; }
.navbar.nav-solid .mega-col a:hover { color: var(--blue); }

.mega-inner { padding: 0; }

.mega-grid { display: grid; gap: 48px; }
.mega-grid.cols-2 { grid-template-columns: repeat(2, 1fr); max-width: 700px; }

/* ===== CTA BUTTON ===== */
.nav-cta .btn-call {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  background: var(--blue);
  text-decoration: none;
  text-transform: none;
  padding: 10px 24px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
  display: inline-block;
}

.nav-cta .btn-call:hover {
  background: #2d55cc;
  transform: translateY(-1px);
}

/* ===== MOBILE TOGGLE ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  /* The bars are only 24×16px — well under the 44px tap-target minimum — so the
     button carries the padding instead. Invisible on desktop (display: none). */
  min-width: 44px;
  min-height: 44px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: background 0.2s, transform 0.25s ease, opacity 0.2s ease;
}

@media (max-width: 960px) {
  /* ── Mobile menu: a dropdown panel under the bar, toggled by .nav-open ──
     Uses display, not opacity/visibility/max-height transitions: a menu that
     depends on a transition to become visible can stay invisible if the
     transition never runs, which is far worse than losing a fade. */
  .nav-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;                       /* bar to viewport bottom, edge to edge */
    overflow-y: auto;
    overscroll-behavior: contain;    /* don't chain scroll to the page behind */
    -webkit-overflow-scrolling: touch;
    background: var(--white);
    /* bottom padding clears the pinned "Call us" bar */
    padding: 8px 0 calc(92px + env(safe-area-inset-bottom, 0px));
    z-index: 998;
  }
  /* Match the bar's inner gutter to the panel rows (24px) so the logo and the
     toggle line up with the menu labels instead of sitting 40px in. */
  .nav-container { padding: 0 24px; }

  .navbar.nav-open .nav-menu { display: block; }

  /* While the panel is open the bar must be opaque white with dark marks, in
     EVERY scroll state. Transparent-state styling is white-on-white on mobile:
     the hamburger bars (#fff) and the logo (brightness(0) invert(1)) would
     vanish against a light page. */
  .navbar.nav-open {
    background: var(--white) !important;
    border-bottom-color: #ebebeb !important;
  }
  .navbar.nav-open .nav-logo img { filter: none !important; }
  .navbar.nav-open .nav-toggle span { background: var(--black) !important; }

  /* "Call us" leaves the bar on mobile and becomes a pinned CTA at the foot of
     the panel — full width, so the menu reads as one sheet from the bar all the
     way to the bottom of the screen. */
  .nav-cta { display: none; }
  .navbar.nav-open .nav-cta {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--white);
    border-top: 1px solid #ebebeb;
    z-index: 999;
  }
  .navbar.nav-open .nav-cta .btn-call {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 24px;
    font-size: 15px;
    background: var(--blue) !important;
    color: var(--white) !important;
    border-color: var(--blue) !important;
  }

  /* The panel is a full-height sheet; stop the page scrolling behind it. */
  body.nav-locked { overflow: hidden; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .navbar .nav-item > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    font-size: 15px;
    color: var(--black) !important;
    background: var(--white);
    border-bottom: 1px solid #f2f2f2;
  }

  /* ── Mega menus: hover can't fire on touch, so tap the parent to expand ── */
  .mega-menu,
  .navbar.nav-solid .mega-menu {
    position: static;
    left: auto;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    width: auto;
    max-width: none;
    max-height: none;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #f7f8fc;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    overflow: visible;
  }
  .nav-item.mega-open .mega-menu { display: block; }
  .nav-item.mega-open > a .arrow { transform: rotate(180deg); }

  .mega-inner { padding: 0; }
  .mega-grid,
  .mega-grid.cols-2 {
    grid-template-columns: 1fr;
    gap: 4px;
    max-width: none;
    padding: 8px 0 14px;
  }
  .mega-col h4,
  .navbar.nav-solid .mega-col h4 {
    color: var(--blue);
    padding: 10px 24px 4px;
    border-bottom: none;
  }
  .mega-col a,
  .navbar.nav-solid .mega-col a {
    padding: 10px 24px;
    color: #444 !important;
    border-bottom: none;
  }
  .mega-col a:hover { padding-left: 28px; }

  .nav-toggle { display: flex; }
  .navbar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .navbar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .navbar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ===== CTA BANNER (shared) ===== */
/* Black rounded banner used at the foot of every page. The 88px the section
   used to spend on one padding is split 36px outside + 52px inside. */
.cta-strip { padding: 36px 0; text-align: center; }
.cta-strip .container {
  background: var(--black);
  border-radius: 8px;
  padding: 52px 40px;
}
.cta-strip h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.15;
  text-transform: uppercase;
}
.cta-strip p { font-size: 14px; color: rgba(255, 255, 255, 0.65); margin-bottom: 40px; }
.cta-strip-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 960px) {
  /* .cta-strip .container sets a full padding shorthand, which wipes out the
     .container gutter — and at (0,2,0) it out-specifies .container, so the black
     banner ran edge-to-edge on mobile. Put the gutter on the section and keep
     the box's own padding for its contents. */
  .cta-strip { padding: 36px 24px; }
  .cta-strip .container { padding: 44px 28px; }
}
@media (max-width: 600px) {
  .cta-strip h2 { font-size: 22px; }
}

/* ===== FOOTER ===== */
/* Shared component: markup in src/_includes/footer.html, inlined into every
   page by build.js. Lives here (not home.css) so any page that loads the shell
   stylesheet gets the footer, exactly like the navbar. */
.footer { background: #f5f6f8; border-top: 1px solid #ebebeb; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 60px;
  padding-top: 60px;
  padding-bottom: 60px;
}
.footer-brand { display: flex; flex-direction: column; gap: 10px; max-width: 260px; }
/* .footer-brand is a column flex container, which stretches its children
   horizontally by default — that distorted the 5:1 logo (it was forced to the
   brand's full width while staying 26px tall). align-self keeps its ratio. */
.footer-logo { height: 26px; width: auto; align-self: flex-start; margin-bottom: 4px; }
.footer-brand > span { font-size: 13px; color: #767676; line-height: 1.5; }
.footer-company { font-size: 11px !important; color: #767676 !important; text-transform: uppercase; letter-spacing: 0.6px; }

/* Certification badges in footer */
.footer-certs { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.footer-cert-badge {
  display: flex;
  align-items: center;
}

/* Certification badge text (the badge images are not present) */
.cert-fallback-text {
  display: none;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: #767676;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid #e5e7eb;
  padding: 4px 10px;
  border-radius: 4px;
}
.cert-text-fallback .cert-fallback-text { display: inline-block; }

.footer-links { display: flex; gap: 56px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
/* The markup uses <h3> for these labels (h5 skipped the heading order and hurt
   a11y). The old selector said h5, so it matched nothing and the labels fell
   back to default heading styling. */
.footer-col h3 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--black);
  margin-bottom: 4px;
}
.footer-col a { font-size: 13px; color: #767676; text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: var(--blue); }
/* Socials on the left, copyright pushed to the right of the same row. */
.footer-bottom { border-top: 1px solid #ebebeb; padding: 20px 0; }
.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-bottom span { font-size: 12px; color: #767676; }

.social-links { display: flex; align-items: center; gap: 10px; }
.social-links a {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #767676;
  border: 1px solid #d5d9e0;
  border-radius: 50%;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.social-links svg { width: 16px; height: 16px; display: block; }
/* Hover: the circle fills with the Xlrate blue and the glyph flips to white.
   Desktop-only, same rule as the navbar: an unscoped :hover would also fire on
   tap-driven mobile and can stick after a tap. */
@media (min-width: 961px) {
  .social-links a:hover {
    color: var(--white);
    background-color: var(--blue);
    border-color: var(--blue);
  }
}
/* Keyboard users get the same state, on every device. */
.social-links a:focus-visible {
  color: var(--white);
  background-color: var(--blue);
  border-color: var(--blue);
}

@media (max-width: 960px) {
  /* The shell's mobile gutter (was in home.css) so the container is consistent
     on every page, and the footer stacks. */
  .container { padding: 0 24px; }

  /* Mobile footer rhythm. Desktop's airy 60px padding and 60px gap are too
     loose on a phone, and `flex-wrap` stranded the third link column on its
     own row. Stack with tighter padding and lay the columns out on an even
     2-up grid so they line up instead of ragging. Desktop is untouched. */
  .footer-inner {
    flex-direction: column;
    gap: 32px;
    padding-top: 44px;
    padding-bottom: 40px;
  }
  .footer-brand { max-width: 320px; }
  /* Touch screens get a comfortable tap target; desktop keeps the compact 34px. */
  .social-links a { width: 40px; height: 40px; }
  .social-links svg { width: 17px; height: 17px; }
  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 24px;
    width: 100%;
  }
}

@media (max-width: 600px) {
  /* Shared type scale: .section-title is 36px on desktop, 24px on phones. */
  .section-title { font-size: 24px; }

  /* Two 34px circles plus the copyright don't fit on one phone-width row, so
     stack them and centre the block. */
  .footer-bottom .container {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
  }
}
