:root {
  --topbar-height: 48px;
  --header-height: 72px;
}

body {
  padding-top: calc(var(--topbar-height) + var(--header-height));
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  height: var(--topbar-height);
  z-index: 1000;
  color: #fff;
  background: radial-gradient(1200px 600px at 10% 10%,rgba(13,37,63,.35),transparent 8%),linear-gradient(135deg,#010a14 0%,#000 60%);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.topbar-inner {
  max-width: 1200px;
  height: 100%;
  margin: auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-text {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  flex: 0 0 auto;
  gap: .5rem;
}

.topbar-link {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}

.topbar-link:hover {
  background: rgba(255,255,255,.1);
}

.site-header {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 999;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 3px 16px rgba(0,0,0,.04);
}

.header-inner {
  max-width: 1200px;
  height: 100%;
  margin: auto;
  padding: .65rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem;
}

.logo {
  display: block;
  max-width: 100%;
  width: auto;
  height: 46px;
}

.header-center {
  justify-self: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.header-nav[hidden] {
  display: none;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.05rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list>li {
  position: relative;
}

.nav-list a {
  color: #111;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--color-red);
}

.nav-has-dd {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.dd-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.dd-toggle .dd-icon {
  width: 15px;
  height: 15px;
  transition: transform .2s;
}

.dd-toggle[aria-expanded=true] .dd-icon {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 260px;
  margin: 0;
  padding: .5rem;
  list-style: none;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(0,0,0,.12);
}

.nav-dropdown li+li {
  margin-top: .15rem;
}

.nav-dropdown a {
  display: block;
  padding: .62rem .7rem;
  border-radius: 8px;
}

.nav-dropdown a:hover {
  background: rgba(229,57,53,.07);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.hamburger,.hamburger:before,.hamburger:after {
  display: block;
  width: 20px;
  height: 2px;
  background: #111;
  transition: .2s;
}

.hamburger {
  position: relative;
  margin: auto;
}

.hamburger:before,.hamburger:after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger:before {
  top: -6px;
}

.hamburger:after {
  top: 6px;
}

.nav-toggle[aria-expanded=true] .hamburger {
  background: transparent;
}

.nav-toggle[aria-expanded=true] .hamburger:before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded=true] .hamburger:after {
  top: 0;
  transform: rotate(-45deg);
}

@media (min-width:901px) {
  .header-nav[hidden] {
    display: block !important;
  }
}

@media (max-width:900px) {
  .header-center {
    justify-self: end;
  }

  .header-right .btn .btn-text {
    display: none;
  }

  .header-right .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .header-nav {
    position: fixed;
    top: calc(var(--topbar-height) + var(--header-height) + 10px);
    left: 12px;
    right: 12px;
    bottom: auto;
    width: auto;
    height: auto;
    transform: none;
    max-height: calc(100dvh - var(--topbar-height) - var(--header-height) - 24px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: .75rem;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(0,0,0,.15);
  }

  .header-nav.is-open {
    display: block;
    animation: none;
    transform: none;
  }

  .nav-list {
    display: grid;
    gap: .2rem;
  }

  .nav-list>li {
    width: 100%;
  }

  .nav-list a {
    display: block;
    padding: .75rem;
    border-radius: 9px;
  }

  .nav-has-dd {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .nav-has-dd>.nav-dropdown {
    grid-column: 1/-1;
    position: static;
    min-width: 0;
    box-shadow: none;
    margin-top: .25rem;
    border-left: 3px solid var(--color-red);
  }
}

@media (max-width:640px) {
  :root {
    --topbar-height: 44px;
    --header-height: 66px;
  }

  .topbar-text {
    font-size: .75rem;
  }

  .topbar-link {
    width: 30px;
    height: 30px;
  }

  .site-header .logo {
    width: min(132px,32vw);
    height: auto;
  }

  .header-inner {
    padding: .55rem .75rem;
    gap: .5rem;
  }

  .header-right {
    gap: .35rem;
  }
}

.topbar-left { flex: 1 1 auto; min-width: 0; }
.header-left { min-width: 0; justify-self: start; }
.logo-link { display: inline-flex; align-items: center; max-width: 100%; }
.btn-ico { width: 18px; height: 18px; }
.jms-logo-fallback { display: inline-block; color: #111; font-size: 1.25rem; font-weight: 800; letter-spacing: .04em; }
.jms-logo-fallback strong { color: var(--color-red); }
