*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--win); color: var(--text); font: 400 16px/26px var(--font); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1 { font-size: var(--h1); line-height: var(--h1-l); font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: var(--h2); line-height: var(--h2-l); font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h3 { font-size: 17px; line-height: 24px; font-weight: 600; }
.lead { font-size: var(--lead); line-height: var(--lead-l); color: var(--text2); }
.label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text2); }
.caption { font-size: 13px; line-height: 20px; color: var(--text2); }
p { max-width: 68ch; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font: 400 13px/20px var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: 16px; top: -64px; z-index: 100; padding: 8px 16px; background: var(--win); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); font-weight: 500; }
.skip:focus { top: 8px; }

.wrap { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* Buttons: 40 px on the page */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; background: var(--win); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); font-size: 15px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; transition: background-color 120ms; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 92%, var(--text)); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn[aria-pressed="true"] { background: var(--hover); font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; background: var(--hover); color: var(--text); border-radius: 14px; font-size: 14px; line-height: 1; white-space: nowrap; }
.card { background: var(--win); border: 1px solid var(--line); border-radius: var(--wr); padding: var(--s5); }

.code { margin: 0; padding: 12px 16px; background: var(--side); border: 1px solid var(--line); border-radius: var(--r); font: 400 13px/20px var(--mono); color: var(--text); overflow-x: auto; white-space: pre; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 50; height: 56px; background: var(--win); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 24px; height: 55px; }
.brand { display: inline-flex; align-items: center; color: var(--text); padding: 4px 0; }
.brand:hover { text-decoration: none; }
.brand { gap: 10px; }
.brand .mk { flex: none; width: 30px; height: 30px; }
.brand .mk rect { fill: var(--text); }
.brand .mk g { stroke: var(--win); }
.brand .mk .dot { fill: var(--win); }
.brand .wm { height: 26px; width: auto; }
.brand .wm g { stroke-width: 12; }
@media (max-width: 480px) { .brand .mk { display: none; } .brand .wm { height: 24px; } }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--r); color: var(--text2); font-size: 15px; font-weight: 500; }
.topnav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.topbar .btn.primary { margin-left: auto; min-height: 36px; font-size: 14px; }
.menu-btn { display: none; }
@media (max-width: 720px) {
  .topbar-in { gap: 8px; }
  .topbar .btn.primary { min-height: 44px; }
  .menu-btn { display: inline-flex; min-height: 44px; font-size: 14px; }
  .topnav { display: none; position: absolute; top: 56px; left: 0; right: 0; margin: 0; padding: 8px var(--gutter) 16px; flex-direction: column; gap: 0; background: var(--win); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .topnav.open { display: flex; }
  .topnav a { min-height: 44px; font-size: 16px; padding: 0 8px; }
}

/* Footer */
.footer { margin-top: var(--section); padding: var(--s7) 0 var(--s6); background: var(--win); border-top: 1px solid var(--line); }
.foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.foot-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); font-weight: 600; font-size: 15px; }
.foot-brand img { width: 24px; height: 24px; }
.mark-d { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark-l { display: none; } :root:not([data-theme="light"]) .mark-d { display: block; } }
:root[data-theme="dark"] .mark-l { display: none; }
:root[data-theme="dark"] .mark-d { display: block; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; color: var(--text2); font-size: 14px; border-radius: var(--r); }
.foot-links a:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.foot-mid { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.seg { display: inline-flex; gap: 4px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--win); }
.seg button { min-height: 28px; padding: 0 12px; border: 0; border-radius: 4px; background: none; color: var(--text2); font-size: 13px; cursor: pointer; }
.seg button:hover { background: var(--hover); color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--hover); color: var(--text); font-weight: 600; }
.foot-lines { display: grid; gap: 4px; margin-top: 24px; }
.foot-lines p { max-width: none; }
@media (max-width: 720px) {
  .seg button { min-height: 44px; padding: 0 16px; }
  .foot-links a { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
