/* HummerFam — tokens */
:root {
  --bg: #f5f3ee; --surface: #ffffff; --surface-2: #ece9e1; --text: #1d1c18; --muted: #6a665b;
  --border: #dcd7cb; --accent: #b4650f; --accent-ink: #ffffff; --link: #8a4a06; --olive: #4d5b2a;
  --warn-bg: #fff4d6; --warn-border: #e5b84a; --code-bg: #efece4;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 14px rgb(0 0 0 / .05);
  --radius: 10px; --header-h: 60px; --side-w: 270px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121210; --surface: #1b1a17; --surface-2: #25241f; --text: #ebe8e0; --muted: #a29d90;
    --border: #34322b; --accent: #e09a3e; --accent-ink: #1b1a17; --link: #f0b267; --olive: #a3b46c;
    --warn-bg: #2e2714; --warn-border: #7d6320; --code-bg: #26251f;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 14px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121210; --surface: #1b1a17; --surface-2: #25241f; --text: #ebe8e0; --muted: #a29d90;
  --border: #34322b; --accent: #e09a3e; --accent-ink: #1b1a17; --link: #f0b267; --olive: #a3b46c;
  --warn-bg: #2e2714; --warn-border: #7d6320; --code-bg: #26251f;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 14px rgb(0 0 0 / .25);
  color-scheme: dark;
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: .9em; background: var(--code-bg); padding: .1em .35em; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin: 0 0 .4em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.logo b { color: var(--accent); }
.top-nav { display: none; gap: 4px; }
.top-nav a { color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.top-nav a:hover, .top-nav a[aria-current] { background: var(--surface-2); color: var(--text); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font-size: 1.1rem; }
.icon-btn:hover { background: var(--surface-2); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; } :root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; } }
.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-switch a { padding: 5px 7px; font-size: .78rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.lang-switch a[aria-current] { background: var(--accent); color: var(--accent-ink); }

/* search */
.search { position: relative; }
.search input { width: 40px; height: 40px; padding: 0 0 0 36px; border: 1px solid transparent; border-radius: 8px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23888' stroke-width='2.2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") 11px center no-repeat; color: var(--text); font: inherit; font-size: .95rem; transition: width .2s; }
.search input:focus { width: min(70vw, 320px); background-color: var(--surface); border-color: var(--border); padding-right: 10px; outline: none; }
.search-results { position: absolute; right: 0; top: 46px; width: min(92vw, 420px); max-height: 70vh; overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.search-results a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.search-results a:hover, .search-results a.active { background: var(--surface-2); }
.search-results small { display: block; color: var(--muted); }

/* layout */
.layout { flex: 1; display: block; padding-top: 20px; padding-bottom: 48px; }
main { min-width: 0; }
.sidenav { position: fixed; inset: 0 auto 0 0; width: min(85vw, 320px); z-index: 60; background: var(--surface); border-right: 1px solid var(--border); padding: 16px; overflow-y: auto; transform: translateX(-100%); transition: transform .2s ease; }
.sidenav.open { transform: none; box-shadow: var(--shadow); }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / .4); }
.sidenav-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sidenav-model { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.sidenav-model small { color: var(--muted); font-weight: 400; }
.sidenav details { border-top: 1px solid var(--border); padding: 8px 0; }
.sidenav summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.sidenav summary a { color: var(--text); text-decoration: none; }
.sidenav ul { list-style: none; margin: 6px 0 0; padding: 0; }
.sidenav li a { display: block; padding: 5px 8px; border-radius: 6px; font-size: .9rem; color: var(--muted); text-decoration: none; }
.sidenav li a:hover { color: var(--text); background: var(--surface-2); }
.sidenav li a[aria-current] { color: var(--accent); background: var(--surface-2); font-weight: 600; }
.sidenav-other { border-top: 1px solid var(--border); padding-top: 10px; display: grid; gap: 6px; font-size: .9rem; }
@media (min-width: 720px) { .top-nav { display: flex; } }
@media (min-width: 1024px) {
  .nav-toggle, .nav-close, .scrim { display: none !important; }
  .layout.has-sidebar { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 36px; }
  .sidenav { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; max-height: calc(100vh - var(--header-h) - 40px); width: auto; transform: none; z-index: 1; background: transparent; border: 0; padding: 0 8px 0 0; }
}

/* components */
.crumbs ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--accent); }
.hero { padding: 28px 0 8px; max-width: 820px; }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0; max-width: 72ch; }
.page-head { margin-bottom: 18px; }
.h-section { font-size: 1.3rem; margin: 34px 0 14px; }
.h-section a { color: inherit; text-decoration: none; } .h-section a:hover { color: var(--accent); }
.model-grid, .card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.model-card, .card { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.model-card:hover, .card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.model-card strong { font-size: 1.2rem; }
.model-badge { align-self: flex-start; font-weight: 800; font-size: .8rem; letter-spacing: .06em; background: var(--olive); color: var(--bg); padding: 2px 8px; border-radius: 6px; }
.model-engines { font-size: .88rem; color: var(--muted); }
.card-tag { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.card-desc { font-size: .9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.btn:hover { color: var(--accent-ink); filter: brightness(1.08); }
.callout { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); font-size: .92rem; color: var(--muted); }
.callout-ok { background: color-mix(in srgb, var(--olive) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--olive) 45%, transparent); color: var(--text); }
.sources ul { font-size: .88rem; color: var(--muted); }
.callout-warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--text); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.part-list { padding-left: 1.2em; }

/* article */
.meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 0; font-size: .88rem; }
.meta div { display: flex; gap: 6px; } .meta dt { color: var(--muted); } .meta dd { margin: 0; font-weight: 600; }
.diff { display: inline-block; width: 40px; height: 6px; border-radius: 3px; margin-right: 6px; vertical-align: middle; background: linear-gradient(90deg, var(--accent) var(--p), var(--border) var(--p)); }
.diff-1 { --p: 20%; } .diff-2 { --p: 40%; } .diff-3 { --p: 60%; } .diff-4 { --p: 80%; } .diff-5 { --p: 100%; }
.article-grid { display: grid; gap: 28px; }
@media (min-width: 1240px) { .article-grid { grid-template-columns: minmax(0, 1fr) 290px; } .article-aside { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; } }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: .92rem; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ul { margin: 8px 0 0; padding: 0; list-style: none; } .toc li { padding: 2px 0; } .toc-l3 { padding-left: 1.1em !important; font-size: .9em; }
.prose { max-width: 75ch; }
.prose h2 { margin-top: 1.8em; font-size: 1.4rem; } .prose h3 { margin-top: 1.4em; font-size: 1.12rem; }
.prose .anchor { float: left; margin-left: -1em; padding-right: .25em; opacity: 0; text-decoration: none; color: var(--muted); }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose li { margin: .25em 0; }
.prose blockquote { margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.prose blockquote p { margin: 0; }
.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; } .faq summary { font-weight: 600; cursor: pointer; } .faq p { margin: 8px 0 0; color: var(--muted); }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.box h2 { font-size: 1rem; margin: 0 0 8px; } .box h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 6px; }
.box ul { margin: 0; padding-left: 1.1em; font-size: .92rem; }
.need-parts { list-style: none; padding: 0 !important; } .need-parts li { padding: 6px 0; border-bottom: 1px dashed var(--border); } .need-parts li:last-child { border: 0; }
.buy { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.buy a { font-size: .78rem; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; }
.buy-lg a.btn { font-size: .95rem; padding: 8px 14px; border: 0; border-radius: 8px; }
.kv div { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); } .kv dt { min-width: 110px; color: var(--muted); } .kv dd { margin: 0; }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; font-size: .85rem; color: var(--muted); background: var(--surface); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; font-weight: 600; }
.site-footer p { margin: 6px 0; max-width: 90ch; }

@media (max-width: 480px) {
  .logo span { display: none; }
  .search input:focus { width: calc(100vw - 32px - 170px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* figures: SVG diagrams inherit theme colors */
.fig { margin: 1.6em 0; }
.fig img { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.fig-svg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.fig-svg svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.fig figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.fig-scheme { margin-top: 8px; font-size: .88rem; } .fig-scheme summary { cursor: pointer; color: var(--link); }
.fig-scheme .fig-svg { margin-top: 8px; } .fig-scheme small { color: var(--muted); }
.f-title { font-size: 23px; font-weight: 700; fill: var(--text); }
.f-label { font-size: 20px; fill: var(--muted); }
.f-year { font-size: 21px; font-weight: 600; fill: var(--muted); }
.f-strong { font-size: 21px; font-weight: 700; fill: var(--text); }
.f-big { font-size: 24px; font-weight: 800; }
.f-num { font-size: 18px; font-weight: 800; fill: var(--accent-ink); }
.f-warn { font-size: 16px; font-weight: 600; fill: #c0392b; }
.f-ok { font-size: 16px; font-weight: 600; fill: var(--olive); }
.f-accent-text { font-size: 20px; font-weight: 700; fill: var(--accent); }
.f-on-seg { fill: var(--bg); }
.f-pan { fill: var(--surface-2); stroke: var(--text); stroke-width: 3; stroke-linejoin: round; }
.f-thin { stroke-width: 2; }
.f-baffle { stroke: var(--text); stroke-width: 3; stroke-dasharray: 6 4; }
.f-oil { fill: var(--accent); opacity: .85; }
.f-plug { fill: var(--text); }
.f-flow { stroke: var(--accent); stroke-width: 3; fill: none; }
.f-flow-muted { stroke: var(--muted); stroke-width: 2.5; fill: none; }
.f-thin-line { stroke: var(--border); stroke-width: 2; fill: none; }
.f-accent-fill { fill: var(--accent); } .f-muted-fill { fill: var(--muted); }
.f-card { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.5; }
.f-icon { fill: none; stroke: var(--olive); stroke-width: 3; stroke-linejoin: round; }
.f-hole { fill: var(--surface-2); stroke: var(--olive); stroke-width: 2.5; }
.f-seg1 { fill: var(--olive); } .f-seg2 { fill: var(--accent); } .f-seg3 { fill: var(--link); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .f-warn { fill: #ff7a6b; } }
:root[data-theme="dark"] .f-warn { fill: #ff7a6b; }
