/* Shared header and responsive navigation for every portfolio page. */
.topbar {
  --line: #d8dee8;
  --muted: #5f6b7a;
  --brand: #155e9f;
  --brand-dark: #124b80;
  --cyan: #11b4c8;
}
.topbar {
      position: sticky;
      top: 0;
      z-index: 20;
      background: rgba(255, 255, 255, 0.92);
      border-bottom: 1px solid rgba(216, 222, 232, 0.88);
      box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
      backdrop-filter: blur(18px);
    }

    .nav {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      width: min(1320px, calc(100% - 32px));
      margin: 0 auto;
      padding: 13px 0;
    }

    .brand {
      display: inline-flex;
      align-items: center;
      flex: 0 0 auto;
      min-width: max-content;
    }

    .brand-logo {
      display: block;
      width: min(260px, 34vw);
      height: 44px;
      object-fit: contain;
      object-position: left center;
    }

    .nav-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      min-width: 0;
    }

    .nav-toggle {
      display: none;
      width: 44px;
      height: 44px;
      flex: 0 0 44px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #ffffff;
      color: var(--brand-dark);
      cursor: pointer;
    }

    .nav-toggle span {
      display: block;
      width: 22px;
      height: 2px;
      background: currentColor;
      transition: transform 0.18s ease, opacity 0.18s ease;
    }

    .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);
    }

    .nav-toggle:focus-visible,
    .nav-actions a:focus-visible,
    .nav-actions button:focus-visible {
      outline: 2px solid var(--brand);
      outline-offset: 3px;
    }

    @media (prefers-reduced-motion: reduce) {
      .nav-toggle span { transition: none; }
    }

    .menu {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 6px;
      font-size: 14px;
    }

    .menu a {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 9px;
      border-radius: 7px;
      color: var(--muted);
      transition: 0.18s ease;
    }

    .menu a:hover {
      color: var(--brand-dark);
      background: linear-gradient(135deg, rgba(224, 242, 254, 0.9), rgba(255, 247, 237, 0.9));
    }

    .menu a[aria-current="page"] {
      color: var(--brand-dark);
      background: #e8f4ff;
      box-shadow: inset 0 0 0 1px rgba(21, 94, 159, 0.12);
    }

    .lang-switch {
      display: inline-flex;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #ffffff;
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }

    .lang-switch button {
      min-width: 40px;
      border: 0;
      border-radius: 999px;
      padding: 6px 10px;
      color: var(--muted);
      background: transparent;
      font-weight: 700;
      cursor: pointer;
    }

    .lang-switch button.is-active {
      color: #ffffff;
      background: linear-gradient(135deg, var(--brand), var(--cyan));
    }
@media (max-width: 1240px) {
      .nav {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
      }

      .nav-actions {
        align-items: flex-start;
        justify-content: flex-start;
        flex-wrap: wrap;
      }

      .menu {
        justify-content: flex-start;
      }

      .brand-logo {
        width: min(230px, 52vw);
      }

      .nav.nav-ready {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
      }

      .nav-ready .nav-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
      }

      .nav-ready .nav-actions {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 12px;
        max-height: calc(100dvh - 86px);
        overflow-y: auto;
        padding: 12px 4px 4px;
        border-top: 1px solid var(--line);
      }

      .nav-ready.is-open .nav-actions {
        display: flex;
      }

      .nav-ready .menu {
        width: 100%;
        flex-direction: column;
        gap: 4px;
      }

      .nav-ready .menu a {
        min-height: 44px;
        padding: 10px 12px;
      }

      .nav-ready .lang-switch button {
        min-height: 44px;
      }
    }
.nav .menu a { text-decoration: none; }
.nav .lang-switch button { font: inherit; font-weight: 700; }
.nav .menu .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 720px) {
  .nav .brand-logo { width: min(200px, 58vw); height: 38px; }
}
