/* =========================================================
   Global navigation — one header for every page
   ========================================================= */

:root {
  --gnav-h: 76px;
  --gnav-max: 1440px;
  --gnav-line: #e5e7eb;
  --gnav-ink: #0a0f1a;
  --gnav-muted: #5b6472;
  --gnav-accent: #3b6cff;
}

.g-nav {
  position: sticky;
  view-transition-name: site-nav;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--gnav-line);
}

.g-inner {
  width: min(100% - 96px, var(--gnav-max));
  margin-inline: auto;
  height: var(--gnav-h);
  display: flex;
  align-items: center;
  gap: 44px;
}

.g-brand { display: flex; align-items: center; flex: none; }
.g-brand img { height: 28px; width: auto; display: block; }

.g-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 34px;
  margin: 0;
  padding: 0;
}
.g-links > li { position: relative; display: flex; align-items: center; }
.g-links > li > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color .18s ease;
}
.g-links > li > a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--gnav-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s cubic-bezier(.2,.7,.2,1);
}
.g-links > li > a:hover { color: var(--gnav-ink); }
.g-links > li > a:hover::after { transform: scaleX(1); }

.g-nav[data-active="cad"] a[data-p="cad"],
.g-nav[data-active="cae"] a[data-p="cae"],
.g-nav[data-active="cas"] a[data-p="cas"],
.g-nav[data-active="custom"] a[data-p="custom"],
.g-nav[data-active="about"] a[data-p="about"],
.g-nav[data-active="legal"] a[data-p="legal"],
.g-nav[data-active="downloads"] a[data-p="downloads"],
.g-nav[data-active="docs"] a[data-p="docs"],
.g-nav[data-active="support"] a[data-p="support"] { color: var(--gnav-ink); font-weight: 600; }

.g-nav[data-active="cad"] a[data-p="cad"]::after,
.g-nav[data-active="cae"] a[data-p="cae"]::after,
.g-nav[data-active="cas"] a[data-p="cas"]::after,
.g-nav[data-active="custom"] a[data-p="custom"]::after,
.g-nav[data-active="about"] a[data-p="about"]::after,
.g-nav[data-active="legal"] a[data-p="legal"]::after,
.g-nav[data-active="downloads"] a[data-p="downloads"]::after,
.g-nav[data-active="docs"] a[data-p="docs"]::after,
.g-nav[data-active="support"] a[data-p="support"]::after { transform: scaleX(1); }

/* Divider between the product links and the utility links */
.g-sep {
  width: 1px;
  height: 18px;
  background: var(--gnav-line);
  margin: 0 2px;
  flex: none;
}

.g-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.g-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--gnav-line);
  border-radius: 4px;
  color: #374151;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .18s ease, color .18s ease;
}
.g-lang:hover { border-color: #c3cbd6; color: var(--gnav-ink); }
.g-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border-radius: 4px;
  background: var(--gnav-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.g-cta:hover { background: #2f5ce6; transform: translateY(-1px); color: #fff; }

/* Help button — sits with the actions, opens the help center */
.g-help {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--gnav-line);
  border-radius: 4px;
  color: #374151;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.g-help svg {
  width: 15px;
  height: 15px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
.g-help:hover {
  border-color: #c3cbd6;
  background: #f8fafc;
  color: var(--gnav-ink);
}

/* Mobile */
.g-mobile { display: none; margin-left: auto; position: relative; }
.g-mobile summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 14px;
  border: 1px solid var(--gnav-line);
  border-radius: 6px;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}
.g-mobile summary::-webkit-details-marker { display: none; }
.g-mobile-menu {
  position: absolute;
  right: 0;
  top: 48px;
  min-width: 260px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--gnav-line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(10, 15, 26, .16);
  display: grid;
}
.g-mobile-menu a {
  padding: 11px 12px;
  border-radius: 6px;
  color: #374151;
  font-size: 14px;
  text-decoration: none;
}
.g-mobile-menu a:hover { background: #f5f7fa; color: var(--gnav-ink); }
.g-mobile-menu .sub { padding-left: 26px; font-size: 13px; color: #6b7280; }
.g-mobile-menu .sep { height: 1px; background: var(--gnav-line); margin: 6px 4px; }
.g-mobile-menu .g-lang-m {
  text-align: center;
  font-weight: 600;
  border: 1px solid var(--gnav-line);
  margin-bottom: 6px;
}
.g-mobile-menu .g-help-m {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  border: 1px solid var(--gnav-line);
  margin-bottom: 6px;
}
.g-mobile-menu .g-help-m svg {
  width: 15px;
  height: 15px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

/* Below this width the full link row plus the Help / language / CTA buttons
   no longer fit on one line, so the header switches to the menu. */
@media (max-width: 1180px) {
  .g-links, .g-actions { display: none; }
  .g-mobile { display: block; }
  .g-inner { width: min(100% - 64px, var(--gnav-max)); }
}
@media (max-width: 560px) {
  .g-inner { width: min(100% - 40px, var(--gnav-max)); }
  .g-brand img { height: 24px; }
}

/* Pages that used a fixed header no longer need extra offset */
main > .hero:first-child { padding-top: 0 !important; }

/* =========================================================
   Global footer
   ========================================================= */
.g-foot {
  background: #070b12;
  color: rgba(255, 255, 255, .55);
  padding: 80px 0 34px;
  view-transition-name: site-foot;
}
.g-foot-inner {
  width: min(100% - 96px, var(--gnav-max));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr);
  gap: 56px;
}
.g-foot-brand img { height: 26px; display: block; }
.g-foot-brand p {
  margin-top: 18px;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255, 255, 255, .45);
}
.g-foot h4 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.g-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.g-foot a {
  color: rgba(255, 255, 255, .55);
  font-size: 14px;
  text-decoration: none;
  transition: color .16s ease;
}
.g-foot a:hover { color: #fff; }
.g-foot-bottom {
  width: min(100% - 96px, var(--gnav-max));
  margin: 56px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .32);
}
@media (max-width: 900px) {
  .g-foot-inner { grid-template-columns: 1fr 1fr; gap: 36px; width: min(100% - 64px, var(--gnav-max)); }
  .g-foot-bottom { width: min(100% - 64px, var(--gnav-max)); }
}
@media (max-width: 560px) {
  .g-foot-inner { grid-template-columns: 1fr; width: min(100% - 40px, var(--gnav-max)); }
  .g-foot-bottom { width: min(100% - 40px, var(--gnav-max)); }
}

/* ---------- Cross-page transition ---------- */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: vt-out .16s ease both;
}
::view-transition-new(root) {
  animation: vt-in .26s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
