/* Core site header — shared source for homepage-style 木 identity.
   The deployed HTML stays static; this file owns the visual behavior only. */
.site-head{
  position:sticky;top:0;z-index:50;
  background:rgba(255,255,255,.96);
  border-bottom:1px solid var(--line,#e2e5e2);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)
}
.site-head .head-in{min-height:72px;display:flex;align-items:center;gap:24px}
.site-head .brand{display:flex;align-items:center;gap:10px;text-decoration:none;flex:0 0 auto}
.site-head .mark-wrap{position:relative;width:42px;height:42px;display:grid;place-items:start;flex:0 0 42px}
.site-head .mark-shadow{position:absolute;z-index:0;left:0;top:0;width:36px;height:36px;display:grid;grid-template-rows:repeat(4,1fr);overflow:hidden;opacity:0;transform:translate(0,0);pointer-events:none;transition:transform .18s ease,opacity .18s ease}
.site-head .mark-shadow i{display:block}
.site-head .mark-shadow i:nth-child(1){background:#d9e8f3}
.site-head .mark-shadow i:nth-child(2){background:#dbe9e4}
.site-head .mark-shadow i:nth-child(3){background:#f2e5bd}
.site-head .mark-shadow i:nth-child(4){background:#dfe5e2}
.site-head .mark{position:relative;z-index:1;width:36px;height:36px;display:grid;place-items:center;border:1.5px solid #4d5752;font-family:var(--serif,"Noto Serif TC","Songti TC","PMingLiU",Georgia,serif);font-size:19px;line-height:1;font-weight:400;background:#fff;color:var(--ink,#24241f);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.site-head .brand:hover .mark{transform:translate(-2px,-2px);background:#fff;border-color:#111;box-shadow:0 4px 12px rgba(36,36,31,.05)}
.site-head .brand:hover .mark-shadow{opacity:1;transform:translate(5px,5px)}
.site-head .brand:active .mark{transform:translate(-1px,-1px)}
.site-head .brand:active .mark-shadow{opacity:1;transform:translate(4px,4px)}
.site-head .brand:focus-visible{outline:2px solid #6c7b75;outline-offset:5px}
.site-head .brand:focus-visible .mark{transform:translate(-2px,-2px);background:#fff;border-color:#111}
.site-head .brand:focus-visible .mark-shadow{opacity:1;transform:translate(5px,5px)}
.site-head .brand-copy strong{display:block;font-family:var(--serif,"Noto Serif TC","Songti TC","PMingLiU",Georgia,serif);font-size:16px;line-height:1.25;font-weight:650;letter-spacing:.01em}
.site-head .brand-copy small{display:block;margin-top:3px;color:var(--muted,#6f746f);font-size:10px;white-space:nowrap}
.site-head .nav{margin-left:auto;display:flex;align-items:center;gap:26px;white-space:nowrap}
.site-head .nav a{--nav-color:#555f5c;position:relative;color:var(--nav-color);border:0;background:transparent;text-decoration:none;font-size:12px;font-weight:750;padding:8px 0;cursor:pointer;transition:color .18s ease}
.site-head .nav .nav-japanese{--nav-color:#214f77}
.site-head .nav .nav-learning{--nav-color:#2f776c}
.site-head .nav .nav-travel{--nav-color:#b27b00}
.site-head .nav .nav-tools{--nav-color:#343b3a}
.site-head .nav a::after{content:"";position:absolute;left:0;right:0;bottom:2px;height:1px;background:currentColor;transform:scaleX(0);transform-origin:right;transition:transform .18s ease}
.site-head .nav a:hover::after,.site-head .nav a:focus-visible::after{transform:scaleX(1);transform-origin:left}
.site-head .nav a:hover,.site-head .nav a:focus-visible{filter:brightness(.82)}

@media(max-width:720px){
  .site-head .shell{width:calc(100% - 28px)}
  .site-head .head-in{min-height:auto;align-items:flex-start;flex-wrap:wrap;gap:0;padding:12px 0 8px}
  .site-head .brand{width:100%;padding-bottom:7px}
  .site-head .mark-wrap{width:40px;height:40px;flex-basis:40px}
  .site-head .mark-shadow{width:34px;height:34px}
  .site-head .mark{width:34px;height:34px;font-size:18px}
  .site-head .brand-copy strong{font-size:15px}
  .site-head .brand-copy small{font-size:9px}
  .site-head .nav{width:100%;margin-left:0;gap:12px;justify-content:space-between;overflow:visible;border-top:1px solid var(--line,#e2e5e2);padding-top:4px}
  .site-head .nav a{font-size:11px;flex:0 0 auto;display:inline-flex;align-items:center;min-height:40px}
}
@media(max-width:390px){
  .site-head .shell{width:calc(100% - 24px)}
  .site-head .head-in{padding:10px 0 8px}
  .site-head .brand-copy strong{font-size:14.5px}
  .site-head .brand-copy small{font-size:8.5px}
  .site-head .nav{gap:0;justify-content:space-between}
  .site-head .nav a{font-size:10.5px}
}
@media(prefers-reduced-motion:reduce){
  .site-head .mark,.site-head .mark-shadow,.site-head .nav a::after{transition:none!important}
  .site-head .brand:hover .mark,.site-head .brand:active .mark,.site-head .brand:focus-visible .mark{transform:none!important}
  .site-head .brand:hover .mark-shadow,.site-head .brand:active .mark-shadow,.site-head .brand:focus-visible .mark-shadow{transform:translate(4px,4px)!important}
}
