/* Top bar: two big categories (SERVICE / COMPANY) like the footer, each opening a small dropdown with its links.
   Desktop: opens on hover / keyboard focus / click.  Mobile (<=760px): the slide-down menu lists every group expanded. */
.nav-group{position:relative; list-style:none;}
.nav-group-btn{
  display:inline-flex; align-items:center; gap:8px;
  font:inherit; font-size:var(--text-body-md-size); font-weight:var(--font-weight-medium);
  letter-spacing:.04em; color:var(--ink-soft);
  background:none; border:0; cursor:pointer; white-space:nowrap;
  padding:var(--space-2) var(--space-5); border-radius:999px;
  transition:color .25s ease, background-color .25s ease;
}
.nav-group-btn::after{
  content:""; width:6px; height:6px; margin-top:-3px;
  border-right:1.6px solid currentColor; border-bottom:1.6px solid currentColor;
  transform:rotate(45deg); transition:transform .25s ease;
}
.nav-group:hover > .nav-group-btn,
.nav-group:has(:focus-visible) > .nav-group-btn,
.nav-group.is-open > .nav-group-btn{color:var(--ink); background:var(--gray);}
.nav-group:hover > .nav-group-btn::after,
.nav-group:has(:focus-visible) > .nav-group-btn::after,
.nav-group.is-open > .nav-group-btn::after{transform:rotate(225deg); margin-top:3px;}

.nav-sub{
  position:absolute; top:100%; left:50%; z-index:20;
  width:150px; box-sizing:border-box; margin:8px 0 0; padding:8px; list-style:none;   /* COMPANY and the language menu share this size */
  background:#141416; border:1px solid var(--line); border-radius:20px;
  box-shadow:0 18px 40px rgba(0,0,0,.45);
  opacity:0; visibility:hidden; transform:translate(-50%,-6px);
  transition:opacity .2s ease, transform .2s ease, visibility .2s;
}
.nav-links > .nav-group:first-child > .nav-sub{width:232px;}   /* SERVICE is wider: its longest name is インフルエンサーMarketing */
.nav-sub::before{content:""; position:absolute; left:0; right:0; top:-10px; height:10px;}   /* keeps the hover alive across the gap */
.nav-group:hover > .nav-sub,
.nav-group:has(:focus-visible) > .nav-sub,
.nav-group.is-open > .nav-sub{opacity:1; visibility:visible; transform:translate(-50%,0);}
.nav-links .nav-sub a{
  display:block; padding:12px; border-radius:12px; white-space:nowrap;
  font-size:14px; color:var(--ink-soft);
}
.nav-links .nav-sub a:hover,
.nav-links .nav-sub a:focus-visible{color:var(--ink); background:var(--gray);}
.nav-links .nav-sub a[aria-current="page"]{color:var(--ink); background:rgba(255,255,255,.08);}

@media (max-width:760px){
  .nav-links .nav-group{width:100%;}
  .nav-links .nav-group-btn{width:100%; padding:var(--space-4) var(--space-2) var(--space-1); cursor:default; pointer-events:none; font-size:12px; letter-spacing:.14em; color:var(--ink-soft); opacity:.7; background:none !important;}
  .nav-links .nav-group-btn::after{display:none;}
  .nav-links .nav-sub{
    position:static; width:auto; min-width:0; margin:0; padding:0; background:none; border:0; box-shadow:none;
    opacity:1; visibility:visible; transform:none; transition:none;
  }
  .nav-links .nav-sub::before{display:none;}
  .nav-links .nav-sub a{padding:var(--space-3) var(--space-2);}
}
@media (prefers-reduced-motion:reduce){.nav-sub,.nav-group-btn::after{transition:none;}}

/* desktop: no pill outline; the categories sit on the right, next to the language menu and the contact button */
@media (min-width:761px){
  :is(.service-chrome, .frame-chrome) .nav{justify-content:flex-start;}
  :is(.service-chrome, .frame-chrome) .nav-links{margin-left:auto; border:0; padding:0; gap:8px;}
  :is(.service-chrome, .frame-chrome) .nav-links > li:has(> .nav-links-cta){display:none;}   /* the empty list item of the hidden mobile-only button would add one more gap */
  :is(.service-chrome, .frame-chrome) .nav-right{margin-left:8px; gap:8px;}   /* same 8px between SERVICE, COMPANY, the language menu and the contact button */
}

/* language menu: same look as the categories, the list opens right-aligned */
.nav-sub.lang-switch{display:block; letter-spacing:0;}
.nav-sub.lang-switch button{
  display:block; width:100%; text-align:left; background:none; border:0; cursor:pointer;
  padding:12px; border-radius:12px; white-space:nowrap;
  font:inherit; font-size:14px; color:var(--ink-soft);
}
.nav-sub.lang-switch button:hover,
.nav-sub.lang-switch button:focus-visible{color:var(--ink); background:var(--gray);}
.nav-sub.lang-switch button.active{font-weight:var(--font-weight-semibold);}

/* dropdown items: one look for SERVICE / COMPANY / language — centred text, and the current page / current language is marked the same way (soft highlight, no extra colour) */
@media (min-width:761px){
  .nav-links .nav-sub a, .nav-sub.lang-switch button{text-align:center;}
}
.nav-links .nav-sub a[aria-current="page"],
.site-header .nav-sub.lang-switch button.active{color:var(--ink); background:rgba(255,255,255,.08); font-weight:var(--font-weight-medium);}
.nav-links .nav-sub a, .nav-sub.lang-switch button{font-weight:var(--font-weight-medium);}

/* home page: same contact button size as the service pages */
@media (min-width:761px){
  .frame-chrome .site-header .btn.btn-sm{display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; width:114px; height:40px; padding:0 12px; border-radius:999px; font-size:14px; font-weight:var(--font-weight-medium); line-height:1; white-space:nowrap;}
}

/* phones: the logo keeps its full size and the contact button moves into the menu (it is already there as .nav-links-cta),
   so logo, language menu and menu toggle fit on one row; the chapter pills on the service pages all fit across the screen */
@media (max-width:760px){
  .site-header .brand-mark{flex-shrink:0;}
  .site-header .nav-right .btn.btn-sm{display:none;}
}
@media (max-width:640px){
  .chr-chapnav li a{padding:8px 10px;}
}
