/* SITE HEADER / NAV - shared across pages (Apple style) */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 5%;
  background: rgba(251, 251, 253, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-logo {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-logo span {
  color: #0071e3;
}

/* Logo mark (images/logo-mark.svg) before the word */
.nav-logo {
  display: inline-flex;
  align-items: center;
}

/* margin, not gap: gap would also split "Be" and "Visible" */
.nav-logo img {
  width: 30px;
  height: 30px;
  flex: none;
  margin-right: 10px;
}

.nav-cta {
  background: #e8590c;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  padding: 9px 20px;
  border-radius: 980px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.nav-cta:hover {
  background: #c64a08;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-actions a {
  white-space: nowrap;
}

.nav-cta-secondary {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  padding: 9px 4px;
  color: #424245;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s;
}

.nav-cta-secondary:hover {
  color: #0071e3;
}

.nav-cta-secondary.is-active {
  color: #1d1d1f;
  font-weight: 600;
}

/* CASES DROPDOWN under «Приклади / Przykłady / Cases» (hover or keyboard focus) */
.nav-drop {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-drop-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-drop-toggle svg {
  transition: transform 0.2s;
}

.nav-drop:hover .nav-drop-toggle svg,
.nav-drop:focus-within .nav-drop-toggle svg {
  transform: rotate(180deg);
}

/* padding-top bridges the gap, so the menu does not close on the way down */
.nav-drop-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  min-width: 290px;
  /* 10px bridge above the white box + 6px inner gap on every side (padding, not link margins:
     the last link's margin-bottom collapsed out of the box and the highlight touched its bottom edge) */
  padding: 16px 6px 6px;
  transform: translate(-50%, 6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}

.nav-drop-menu::before {
  content: "";
  position: absolute;
  inset: 10px 0 0;
  z-index: -1;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
}

.nav-drop:hover .nav-drop-menu,
.nav-drop:focus-within .nav-drop-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.nav-drop-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13.5px;
  color: #1d1d1f;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-drop-menu a:hover,
.nav-drop-menu a:focus-visible {
  background: #f2f5fb;
  color: #0071e3;
}

/* LANGUAGE SWITCHER */
.nav-lang {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 980px;
  padding: 2px;
}

.nav-lang a {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 980px;
  color: #424245;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav-lang a:hover {
  color: #0071e3;
}

.nav-lang a.lang-active {
  background: #1d1d1f;
  color: #ffffff;
}

.nav-lang a.lang-active:hover {
  color: #ffffff;
}

.nav-mobile .nav-lang {
  align-self: center;
  margin-top: 8px;
}

.nav-mobile .nav-lang a {
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 980px;
  text-align: center;
}

/* MOBILE NAV */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition:
    transform 0.25s,
    opacity 0.25s;
}

nav.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

nav.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

nav.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: 57px;
  background: rgba(0, 0, 0, 0.4);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.nav-mobile-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile {
  display: none;
  position: fixed;
  top: 57px;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(251, 251, 253, 0.97);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px 5% 20px;
  max-height: calc(100vh - 57px);
  overflow-y: auto;
  flex-direction: column;
  gap: 2px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.25s,
    opacity 0.25s;
}

nav.nav-open .nav-mobile {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile a {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  padding: 11px 18px;
  border: none;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  transition:
    background 0.2s,
    color 0.2s;
}

.nav-mobile a:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-mobile a.nav-mobile-cta {
  margin-top: 8px;
  background: #e8590c;
  color: #ffffff;
}

.nav-mobile a.nav-mobile-cta:hover {
  background: #c64a08;
}

/* «Приклади / Przykłady / Cases / Casos» in the burger menu: a row that opens the case list */
.nav-mobile-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  padding: 11px 18px;
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s;
}

.nav-mobile-expand:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-mobile-expand svg {
  transition: transform 0.2s;
}

.nav-mobile-expand[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nav-mobile-cases[hidden] {
  display: none;
}

.nav-mobile .nav-mobile-cases a.nav-mobile-all {
  font-weight: 600;
  color: #0071e3;
}

/* Case links under «Приклади» in the burger menu: smaller, grouped */
.nav-mobile-cases {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0 4px;
  padding: 4px 6px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.03);
}

.nav-mobile .nav-mobile-cases a {
  font-size: 13.5px;
  line-height: 1.3;
  padding: 5px 12px;
  color: #424245;
}

.nav-mobile a.is-active {
  font-weight: 600;
  background: rgba(0, 0, 0, 0.05);
}

body.nav-open {
  overflow: hidden;
}

/* burger below 1080px: the desktop row (6 items + trial button) needs ~980px */
@media (max-width: 1080px) {
  .nav-actions {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-mobile {
    display: flex;
  }

  .nav-mobile-backdrop {
    display: block;
  }
}

/* short phones (320x568): with the case list open the language switcher stays on screen (6 rows since «Сайти», 04.10.2026) */
@media (max-width: 1080px) and (max-height: 600px) {
  .nav-mobile {
    padding-top: 8px;
  }

  .nav-mobile a,
  .nav-mobile-expand {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .nav-mobile .nav-mobile-cases a {
    padding-top: 4px;
    padding-bottom: 4px;
  }
}
