/* Kingdom 1810 shared site chrome: the top bar, the menu panel, the footer and the type scale.
   Colours, fonts and sizes come from brand/tokens.css (link it first). Never use a literal colour here.
   Two densities, one design:
     public site (default)  roomy and editorial: hero 44-52px (phone 32-36), section 28-32 (phone 24), card 18-20, body 16, labels 13
     Kingdom Hub / Mod Hub  compact and practical (<body class="hub">): title 24 (phone 22), section 20 (phone 18), card 17, body 15, labels 13 */
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:90px;background:var(--bg)}
@supports (zoom:1){html{zoom:var(--fs)}}
@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto}*{transition:none!important}}
body{margin:0;background:var(--bg);color:var(--fg);font:400 16px/1.5 var(--f-body);-webkit-text-size-adjust:100%}
body.hub{font-size:15px}
h1,h2,h3,h4{font-family:var(--f-display);margin:0;line-height:1.2;font-weight:800;letter-spacing:-.01em}
p{max-width:75ch}
b,strong{font-weight:600}
/* links in running text take the accent; the underline keeps them recognisable */
.inner-main a:not([class]),.lede a,p a:not([class]){color:var(--accent);text-underline-offset:3px}
a{color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.wrap{max-width:1080px;margin:0 auto;padding:0 24px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
img.photo,.photo img{filter:brightness(var(--img-dim))}
/* buttons: the main button of a page takes the accent; the other is a quiet outline */
.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;text-decoration:none;font:600 15px var(--f-body);padding:0 22px;border-radius:8px;border:1px solid var(--accent);cursor:pointer}
.btn.gold{background:var(--accent);color:var(--accent-ink)}
.btn.gold:hover{filter:brightness(1.08)}
.btn.line{color:var(--fg);border-color:var(--line);background:var(--surface)}
.btn.line:hover{background:var(--raised)}
/* labels: small, uppercase, accent-coloured section name */
.label{font:600 13px var(--f-display);letter-spacing:.12em;text-transform:uppercase;color:var(--accent);margin-bottom:8px}
.inner-main{padding:122px 0 72px;min-height:60vh}
@media (max-width:860px){.inner-main{padding:76px 0 56px}html{scroll-padding-top:70px}}
.inner-main h1{font-size:clamp(32px,4.4vw,48px);letter-spacing:-.02em}
.inner-main .lede{color:var(--muted);max-width:62ch;margin:12px 0 0}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:20px;margin-top:20px}
.panel h2{font-size:clamp(24px,2.6vw,30px);margin-bottom:8px}
.lock{display:inline-block;width:.9em;height:.9em;vertical-align:-.1em;margin-left:6px}
.menu-lock svg{width:15px;height:15px}
/* hub density: smaller titles, tighter gaps */
body.hub.hub .inner-main h1{font-size:24px;letter-spacing:-.01em}
body.hub.hub .panel h2,body.hub.hub main h2{font-size:20px}
body.hub.hub main h3{font-size:17px}
body.hub.hub .panel{padding:16px;margin-top:14px;border-radius:12px}
body.hub.hub .label,body.hub.hub h3.k{font-size:13px}
@media (max-width:640px){
  body.hub.hub .inner-main h1{font-size:22px}
  body.hub.hub .panel h2,body.hub.hub main h2{font-size:18px}
  .inner-main h1{font-size:32px}
  .panel h2{font-size:24px}
}

/* ---------- top bar: fixed; transparent over a hero photo, solid on every other page ---------- */
header.top{--ink:var(--fg);position:fixed;top:0;left:0;right:0;z-index:50;color:var(--ink)}
header.top::before,header.top::after{content:"";position:absolute;inset:0;pointer-events:none;transition:opacity .25s ease}
header.top::before{background:linear-gradient(rgba(0,0,0,.6),rgba(0,0,0,0));height:140%;opacity:0}   /* soft dark fade from the top, over a hero photo */
header.top::after{background:var(--surface);border-bottom:1px solid var(--line);opacity:1}
body.over-hero header.top{--ink:#fff}
body.over-hero header.top::before{opacity:1}
body.over-hero header.top::after{opacity:0}
body.over-hero header.top.solid{--ink:var(--fg)}
body.over-hero header.top.solid::before{opacity:0}
body.over-hero header.top.solid::after{opacity:1}
header.top .bar{position:relative;z-index:3;height:60px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;padding:0 20px;transition:height .2s ease}
header.top .l{display:flex;align-items:center;gap:10px;justify-self:start;min-width:0}
header.top .r{display:flex;align-items:center;gap:8px;justify-self:end;min-width:0}
header.top.compact .bar{height:52px}
.brand{display:block;line-height:0;position:relative}
.brand img{height:36px;width:auto;display:block;transition:opacity .2s ease,height .2s ease}
header.top.compact .brand img{height:30px}
/* the logo uses the text colour: charcoal on light, white on dark (and white over a hero photo) */
.brand .lg-white{position:absolute;left:0;top:0;opacity:0}
:root[data-theme="dark"] .brand .lg-char{opacity:0}
:root[data-theme="dark"] .brand .lg-white{opacity:1}
body.over-hero header.top:not(.solid) .brand .lg-char{opacity:0}
body.over-hero header.top:not(.solid) .brand .lg-white{opacity:1}

/* the links under the logo (computers) */
header.top .links{position:relative;z-index:2;display:flex;justify-content:center;padding:0 20px;height:34px;transition:height .2s ease}
header.top.compact .links{height:30px}
.links ul{list-style:none;margin:0;padding:0}
.links>ul{display:flex;gap:28px;align-items:stretch}
.links>ul>li{position:relative;display:flex}
.links a.tl{display:flex;align-items:center;font:600 14px var(--f-display);letter-spacing:.04em;color:inherit;text-decoration:none;border-bottom:2px solid transparent;padding:0 1px;margin-bottom:2px;transition:color .15s}
.links a.tl:hover,.links .has-dd:focus-within>a.tl{color:var(--accent)}
body.over-hero header.top:not(.solid) .links a.tl:hover{color:inherit;border-bottom-color:currentColor}
.links a.tl.cur{border-bottom-color:var(--accent)}
.links .dd{display:none;position:absolute;top:100%;left:50%;transform:translateX(-50%);min-width:220px;padding:6px 0;background:var(--surface);color:var(--fg);border:1px solid var(--line);border-radius:12px}
.links .has-dd:hover>.dd,.links .has-dd:focus-within>.dd{display:block}
.links .dd a{display:block;padding:9px 18px;text-decoration:none;font:500 14px var(--f-body);white-space:nowrap}
.links .dd a:hover,.links .dd a:focus-visible{background:var(--raised);color:var(--accent)}

/* the right side: language, light/dark, Kingdom Hub, account */
.ic-btn{display:inline-grid;place-items:center;width:44px;height:44px;border-radius:999px;border:1px solid transparent;background:none;color:inherit;cursor:pointer;padding:0}
.ic-btn:hover{background:color-mix(in srgb,currentColor 12%,transparent)}
.ic-btn svg{width:20px;height:20px}
.theme-btn .sun{display:none}
:root[data-theme="dark"] .theme-btn .sun{display:block}
:root[data-theme="dark"] .theme-btn .moon{display:none}
.hub-btn{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 18px;border-radius:999px;background:var(--accent);color:var(--accent-ink);font:600 14px var(--f-display);text-decoration:none;white-space:nowrap;transition:filter .15s}
.hub-btn:hover{filter:brightness(1.08)}
body.over-hero header.top:not(.solid) .hub-btn{background:#fff;color:#161616}
.hub-btn .lock{width:15px;height:15px;margin:0;vertical-align:baseline}
.hub-btn .short{display:none}
.who{position:relative}
.who-btn{display:inline-flex;align-items:center;gap:6px;max-width:190px;background:none;border:0;color:inherit;cursor:pointer;font:500 14px var(--f-body);padding:8px 4px;border-radius:6px}
.who-btn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.caret{width:14px;height:14px;flex:none}
.who-menu,.lang-list{position:absolute;top:calc(100% + 6px);min-width:210px;margin:0;padding:6px 0;list-style:none;background:var(--surface);color:var(--fg);border:1px solid var(--line);border-radius:12px;z-index:70}
.who-menu{right:0}
.lang-list{right:0}
.who-menu a,.who-menu button,.lang-list button{display:block;width:100%;text-align:left;min-height:44px;padding:10px 16px;background:none;border:0;color:inherit;font:500 14px var(--f-body);text-decoration:none;cursor:pointer}
.who-menu a:hover,.who-menu button:hover,.lang-list button:hover{background:var(--raised);color:var(--accent)}
.lang-list [aria-selected="true"] button{font-weight:600;box-shadow:inset 3px 0 0 var(--accent)}
.lang-list button[disabled]{color:var(--muted);cursor:default;background:none}
.lang-list small{color:var(--muted);font-size:13px;margin-left:6px}
.lang{position:relative}
.lang-note{margin:10px 0 0;font-size:14px;color:var(--muted)}
.lang.dsk .lang-note{display:none}
.menu-btn{display:none;align-items:center;gap:8px;min-height:44px;background:none;border:0;color:inherit;cursor:pointer;font:600 14px var(--f-display);letter-spacing:.06em;text-transform:uppercase;padding:0 6px;margin-left:-6px;border-radius:6px}
.menu-btn svg{width:22px;height:22px;flex:none}
.notice{position:fixed;top:110px;left:50%;transform:translateX(-50%);z-index:55;max-width:92vw;padding:10px 20px;border-radius:999px;background:var(--surface);border:1px solid var(--line);color:var(--fg);font-size:14px;text-align:center}

/* phones: the links fold into the MENU panel; language and light/dark stay in the bar */
@media (max-width:860px){
  header.top .bar{height:58px;padding:0 8px 0 12px;gap:2px;grid-template-columns:auto 1fr auto}
  header.top .brand{justify-self:center}
  header.top.compact .bar{height:52px}
  .dsk{display:none!important}
  .menu-btn{display:inline-flex}
  .brand img{height:28px}
  header.top.compact .brand img{height:26px}
  header.top .r{gap:0}
  .hub-btn{min-height:40px;padding:0 12px;margin-left:2px}
  .hub-btn .full{display:none}.hub-btn .short{display:inline}
  .notice{top:70px}
  header.top .lang.in-bar .lang-list{right:-60px}
}
@media (min-width:861px){header.top .lang.in-bar .lang-list{right:0}}

/* the full-screen menu panel (phones) */
.drawer{position:fixed;inset:0;z-index:61;background:var(--bg);color:var(--fg);opacity:0;visibility:hidden;transform:translateY(-8px);transition:opacity .2s ease,transform .2s ease,visibility .2s;overflow-y:auto;overscroll-behavior:contain}
.drawer.on{opacity:1;visibility:visible;transform:none}
body.menu-open{overflow:hidden}
.d-in{max-width:560px;margin:0 auto;padding:0 20px 32px}
.d-top-row{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;padding:8px 0;background:var(--bg);border-bottom:1px solid var(--line)}
.d-top-row .t{font:600 14px var(--f-display);letter-spacing:.06em;text-transform:uppercase}
.drawer .x{width:46px;height:46px;display:grid;place-items:center;background:none;border:0;color:inherit;cursor:pointer;border-radius:8px}
.drawer .x svg{width:24px;height:24px}
.d-sec{padding-top:12px}
.drawer a.d-top{display:flex;align-items:center;min-height:44px;font:800 16px var(--f-display);color:var(--fg);text-decoration:none}
.drawer a.d-top.cur{box-shadow:0 2px 0 var(--accent);display:inline-flex}
.d-sec ul{list-style:none;margin:0 0 6px;padding:0}
.d-sec li a{display:flex;align-items:center;min-height:44px;padding:0 0 0 14px;border-left:2px solid var(--line);font:500 15px var(--f-body);text-decoration:none}
.d-sec li a:hover{color:var(--accent);border-left-color:var(--accent)}
.drawer .set-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:18px 0 4px}
.drawer .lang-btn{border-color:var(--line)}
.drawer .acct{margin-top:16px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.drawer .acct b{display:block;font:800 16px var(--f-display)}
.drawer .acct span{display:block;color:var(--muted);font-size:14px;margin-top:2px}
.drawer .acct .row{display:flex;align-items:center;gap:12px}
.drawer .acct img{width:44px;height:44px;border-radius:50%;flex:none;background:var(--raised)}
.drawer .acct a,.drawer .acct button{display:flex;align-items:center;width:100%;min-height:44px;text-align:left;margin:0;padding:0;border:0;border-top:1px solid var(--line);background:none;color:var(--fg);font:500 15px var(--f-body);cursor:pointer;text-decoration:none}
.drawer .acct .row+a,.drawer .acct .alt+a{margin-top:12px}
.drawer .acct a:hover,.drawer .acct button:hover{color:var(--accent)}
.drawer .acct .verify{justify-content:center;border:0;border-radius:999px;background:var(--accent);color:var(--accent-ink);font:600 15px var(--f-display)}
.drawer .acct .plain{justify-content:center;border-top:0;text-decoration:underline}
.drawer .acct .alt{margin-top:8px}
.d-contact{display:flex;align-items:center;min-height:44px;margin-top:14px;border-top:1px solid var(--line);font:600 15px var(--f-display);text-decoration:none}
.sizer{display:inline-flex;border:1px solid var(--line);border-radius:999px;overflow:hidden}
.sizer button{min-height:44px;min-width:44px;border:0;background:var(--surface);color:var(--fg);font:600 14px var(--f-display);cursor:pointer}
.sizer button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink)}

/* footer on every page: quiet gray */
.site-foot{background:var(--surface);color:var(--muted);border-top:1px solid var(--line);padding:24px 0;font-size:14px}
.site-foot .wrap{display:flex;flex-wrap:wrap;gap:10px 24px;align-items:center;justify-content:center}
.site-foot img{height:26px;width:auto;display:block}
.site-foot .lg-white{display:none}
:root[data-theme="dark"] .site-foot .lg-char{display:none}
:root[data-theme="dark"] .site-foot .lg-white{display:block}
.site-foot a{color:var(--fg)}
/* the thin accent bar at the very top of the page */
body::before{content:"";position:fixed;top:0;left:0;right:0;height:3px;background:var(--accent);z-index:90}

/* ---------- Kingdom Hub shell: sidebar (computers) and bottom tab bar (phones). Gray; only the active item takes the accent. ---------- */
.hubnav,.tabbar{display:none}
@media (min-width:900px){
  body.hub-nav .hubnav{display:flex;flex-direction:column;position:fixed;top:94px;left:0;bottom:0;width:232px;z-index:40;background:var(--surface);border-right:1px solid var(--line);padding:16px 12px 12px;overflow-y:auto}
  body.hub-nav .inner-main{padding-left:232px;padding-top:112px}
  body.hub-nav .site-foot{padding-left:232px}
}
.hn-groups{flex:1}
.hn-h{font:600 13px var(--f-display);letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:18px 10px 6px}
a.hn{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 10px;border-radius:8px;text-decoration:none;color:var(--fg);font:500 14px var(--f-body);position:relative}
a.hn svg{width:20px;height:20px;flex:none;color:var(--muted)}
a.hn:hover{background:var(--raised)}
a.hn.on{background:var(--acc-bg);color:var(--accent);font-weight:600}
a.hn.on svg{color:var(--accent)}
a.hn.on::before{content:"";position:absolute;left:-12px;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--accent)}
.hn-me{display:flex;align-items:center;gap:10px;padding:12px 8px 4px;margin-top:10px;border-top:1px solid var(--line);text-decoration:none;color:var(--fg)}
.hn-me .nm{min-width:0}.hn-me b{display:block;font:600 14px var(--f-body);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hn-me small{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:13px}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--muted);flex:none}
@media (max-width:899px){
  body.hub-nav{padding-bottom:calc(64px + env(safe-area-inset-bottom))}
  body.hub-nav .tabbar{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;z-index:45;background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
  a.tb{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:56px;text-decoration:none;color:var(--muted);font:500 12px var(--f-body)}
  a.tb svg{width:22px;height:22px}
  a.tb.on{color:var(--accent);font-weight:600;box-shadow:inset 0 2px 0 var(--accent)}
  body.hub-nav .inner-main{padding-top:72px}
}
.hub-menu-sec{padding-top:12px}
.hub-menu-sec ul{list-style:none;margin:0;padding:0}
.hub-menu-sec a{display:flex;align-items:center;min-height:44px;padding-left:14px;border-left:2px solid var(--line);text-decoration:none;font:500 15px var(--f-body)}
.hub-menu-sec a:hover{color:var(--accent);border-left-color:var(--accent)}

/* phones: buttons and menu items are at least 44px tall */
@media (max-width:860px){
  .btn,.b,.btn2,.btn2.sm,.b.sm,.seg button,.tabs button,.mx-btn,.hubtab,.chipset label,button.t,.sizer button{min-height:44px}
  .btn2.sm,.b.sm{padding-top:0;padding-bottom:0}
}
