/* docs.minmaxify.com: the website's colours, fonts and header (marketing/website/src/assets/css/site.css),
   with a docs layout: category sidebar, article, "On this page". No framework, no build step. */

@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("/assets/fonts/poppins-400-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("/assets/fonts/poppins-500-latin.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("/assets/fonts/poppins-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/inter-latin-var.woff2") format("woff2"); }

:root {
  --navy: #041352;
  --ink: #1e2a5a;
  --muted: #5b6488;
  --line: #e2e8f0;
  --panel: #f1f5f9;
  --cyan: #00e4ff;
  --magenta: #ff00ff;
  --blue: #193ed2;
  --link: #195ae6;
  --white: #fff;
  --head: "Poppins", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1300px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--white); line-height: 1.6; -webkit-font-smoothing: antialiased; font-size: 16px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; color: var(--navy); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 3.6vw, 42px); }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; padding-top: 48px; padding-bottom: 48px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: 19px; color: var(--muted); }
.eyebrow { font-family: var(--head); font-weight: 600; color: var(--blue); font-size: 16px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .6em; }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: var(--white); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--navy); color: var(--white); font-family: var(--head); font-weight: 600; font-size: 17px; text-decoration: none; padding: 12px 22px; border-radius: 12px; border: 0; cursor: pointer; white-space: nowrap; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(4, 19, 82, .25); }
.btn-sm { font-size: 15px; padding: 8px 18px; }

/* Header (as on the website) */
.site-header { position: sticky; top: 10px; z-index: 50; padding: 0 20px; margin-top: 10px; }
.nav { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 20px; box-shadow: rgba(4, 19, 82, .11) 0 .6px .54px -1.25px, rgba(4, 19, 82, .094) 0 2.29px 2.06px -2.5px, rgba(4, 19, 82, .06) 0 10px 18px -3.75px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); font-weight: 700; font-size: 18px; flex-shrink: 0; }
.brand-sub { font-weight: 500; color: var(--muted); }
.nav-links { list-style: none; display: flex; align-items: center; gap: 22px; margin: 0 0 0 auto; padding: 0; }
.nav-links a:not(.btn) { color: var(--navy); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav-links a:not(.btn):hover { text-decoration: underline; }

/* Search */
.search { position: relative; display: flex; gap: 10px; }
.search input { flex: 1; min-width: 0; font: inherit; color: var(--navy); border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 10px 14px 10px 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%235b6488' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 13px center; }
.search input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; background-color: var(--white); }
.search-nav { flex: 1; max-width: 420px; }
.search-hero input { font-size: 18px; padding: 16px 18px 16px 44px; background-color: var(--white); border-color: transparent; box-shadow: 0 10px 30px rgba(4, 19, 82, .12); background-position: 16px center; }
.search-hero .btn { padding: 0 26px; }
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(4, 19, 82, .16); list-style: none; margin: 0; padding: 6px; z-index: 60; text-align: left; }
.suggest a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--navy); }
.suggest a span { display: block; font-size: 13px; color: var(--muted); }
.suggest a:hover, .suggest a.active { background: var(--panel); }
.suggest .all { font-weight: 600; color: var(--link); }
mark { background: rgba(0, 228, 255, .28); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Home */
.hero { position: relative; overflow: hidden; text-align: center; padding: 72px 0 64px; margin-top: -76px; padding-top: 148px; background: radial-gradient(1100px 380px at 15% 0%, rgba(0, 228, 255, .20), transparent 70%), radial-gradient(900px 360px at 90% 10%, rgba(255, 0, 255, .12), transparent 70%), var(--panel); }
.hero h1 { font-size: clamp(36px, 5vw, 58px); margin-bottom: 28px; }
.hero .search { max-width: 720px; margin: 0 auto; }
.popular { margin: 22px auto 0; max-width: 820px; color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; align-items: center; }
.popular a { color: var(--navy); background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; text-decoration: none; font-size: 14px; }
.popular a:hover { border-color: var(--navy); }
.categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding-top: 48px; padding-bottom: 24px; }
.card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.card:hover { border-color: transparent; box-shadow: 0 12px 30px rgba(4, 19, 82, .12); transform: translateY(-2px); }
.card h2 { font-size: 20px; margin-bottom: 6px; }
.card p { color: var(--muted); flex: 1; }
.card .count { font-family: var(--head); font-weight: 500; color: var(--link); font-size: 15px; }

/* Docs layout */
.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 48px; padding-top: 40px; padding-bottom: 56px; align-items: start; }
.sidebar, .toc { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; font-size: 14.5px; }
.sidebar details { border-bottom: 1px solid var(--line); padding: 8px 0; }
.sidebar summary { cursor: pointer; font-family: var(--head); font-weight: 600; color: var(--navy); padding: 4px 0; list-style: none; display: flex; justify-content: space-between; }
.sidebar summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.sidebar details[open] summary::after { content: "–"; }
.sidebar ul { list-style: none; margin: 4px 0 4px; padding: 0; }
.sidebar a { display: block; color: var(--ink); text-decoration: none; padding: 5px 10px; border-radius: 8px; line-height: 1.35; }
.sidebar a:hover { background: var(--panel); }
.sidebar a[aria-current="page"] { background: var(--panel); color: var(--navy); font-weight: 600; box-shadow: inset 3px 0 0 var(--cyan); }
.toc p { font-family: var(--head); font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0 4px 14px; margin-left: -2px; border-left: 2px solid transparent; line-height: 1.35; }
.toc a:hover { color: var(--navy); }
.toc a.active { color: var(--navy); border-left-color: var(--magenta); }
.crumbs { font-size: 14px; color: var(--muted); display: flex; gap: 8px; margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--navy); text-decoration: underline; }
.updated { color: var(--muted); font-size: 14px; margin-top: -4px; }

/* Article text */
.prose { font-size: 16.5px; max-width: 760px; }
.prose h2 { font-size: 25px; margin-top: 1.8em; padding-top: .2em; }
.prose h3 { font-size: 19px; margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); }
.prose ol > li::marker { font-family: var(--head); font-weight: 600; color: var(--blue); }
.prose strong { color: var(--navy); font-weight: 600; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .1em .35em; overflow-wrap: anywhere; }
.prose pre { background: var(--navy); color: #e6ebff; border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose blockquote { margin: 0 0 1em; padding: 12px 18px; background: var(--panel); border-left: 3px solid var(--cyan); border-radius: 0 10px 10px 0; }
.prose blockquote p { margin: 0; }
.prose img { margin: 0 0 1.2em; max-width: 600px; width: 100%; border: 1px solid var(--line); border-radius: 10px; }
.table { overflow-x: auto; margin: 0 0 1.3em; border: 1px solid var(--line); border-radius: 12px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--panel); font-family: var(--head); font-weight: 600; color: var(--navy); }
.prose tr:last-child td { border-bottom: 0; }

/* Lists of articles */
.article-list { list-style: none; padding: 0; margin: 24px 0; border-top: 1px solid var(--line); }
.article-list li { border-bottom: 1px solid var(--line); }
.article-list a { display: block; padding: 16px 4px; text-decoration: none; color: var(--ink); }
.article-list a:hover strong { text-decoration: underline; }
.article-list strong { display: block; font-family: var(--head); font-weight: 600; color: var(--navy); font-size: 17px; margin-bottom: 2px; }
.article-list span { color: var(--muted); font-size: 15px; }
.related { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.related h2 { font-size: 19px; }
.related ul { padding-left: 1.2em; }
.related li { margin: .3em 0; }

/* Help band */
.help-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 48px 0 8px; padding: 26px 30px; border-radius: 18px; color: var(--white); background: linear-gradient(120deg, var(--navy) 0%, #0b2a8a 70%, #1b47c9 100%); }
.help-band h2 { color: var(--white); font-size: 22px; margin-bottom: 4px; }
.help-band p { margin: 0; color: #c9d4ff; }
.help-band .btn { background: var(--white); color: var(--navy); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; padding: 28px 0; background: var(--panel); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; font-size: 14px; }
.footer-links a { color: var(--navy); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* Narrower screens */
@media (max-width: 1180px) {
  .docs { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .sidebar { position: static; max-height: none; order: 2; }
  .nav { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .search-nav { order: 3; flex-basis: 100%; max-width: none; }
  .nav-links a:not(.btn), .brand-sub { display: none; }
  .hero { padding-top: 170px; }
  .search-hero { flex-direction: column; }
  .search-hero .btn { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Drafts (draft: true): banner on the page and on /drafts */
.draft-banner { background: #fff4d6; border: 1px solid #f2c94c; color: #5c4400; border-radius: 12px; padding: 12px 16px; font-size: 15px; margin-bottom: 20px; }
.draft-banner a { color: #5c4400; font-weight: 600; }

/* Cookie consent banner (Google Analytics; markup in ../website/analytics.mjs) */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 600px; margin: 0 auto; background: var(--white); color: var(--navy); border-radius: 16px; box-shadow: 0 10px 40px rgba(4, 19, 82, .25); padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 260px; font-size: 15px; }
.consent-buttons { display: flex; gap: 10px; }
.btn-outline { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-size: 15px; color: inherit; cursor: pointer; }
