/*
 * Mitts Build — styles of the documentation and benchmark pages
 * Copyright (c) 2026 Alexander Panasenko
 *
 * Contact: alex@prod.codes
 * Author: https://prod.codes/about/
 * Project: https://github.com/alex09x/mitts
 * SPDX-License-Identifier: MIT OR Apache-2.0
 */

:root { --p1: #c9ced4; --good: #7ddc9a; }
.nav a[aria-current="page"] { color: var(--ink); }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 40px 0 56px; margin-top: 64px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* shared prose */
.doc-head { padding: 24px 0 8px; }
.doc-head h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1; }
.doc-head .lede { margin: 20px 0 0; max-width: 46em; }
main h2 { font-size: clamp(26px, 3vw, 36px); margin: 56px 0 16px; padding-top: 8px; }
main h3 { font-size: 22px; margin: 36px 0 10px; }
main h4 { font: 600 13px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 24px 0 8px; }
main section { scroll-margin-top: 68px; }
.params code { overflow-wrap: anywhere; }
main p, main li, main dd { color: #d6d9dd; }
main ul, main ol { padding-left: 1.3em; }
main li { margin: 6px 0; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 3px; font-size: .88em; }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; overflow-x: auto; margin: 14px 0; }
pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.6; }
.sub, .note, .hint { color: var(--muted); }
.note { border-left: 3px solid var(--line); padding-left: 14px; }

/* tables */
.ref { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
.ref th { text-align: left; font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ref td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ref td.flag { white-space: nowrap; width: 1%; }
.ref .more { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.ref.nums td:not(:first-child), .ref.nums th:not(:first-child) { text-align: right; }
.ref.nums td:first-child { font-family: var(--mono); font-size: 14px; }
.tablewrap { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.tablewrap .ref { margin: 0; }
.tablewrap th { position: sticky; top: 0; background: var(--panel); }

/* definition lists */
.params dt { font-weight: 600; color: var(--ink); margin-top: 18px; font-family: var(--display); font-size: 17px; }
.params dd { margin: 4px 0 0; }

/* docs layout */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; }
.docs.guide { grid-template-columns: minmax(0, 1fr); }
.toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; font-size: 14px; padding: 8px 8px 24px 0; }
.toc-h { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 20px 0 6px; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 3px 0; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.doc { min-width: 0; max-width: 860px; }
.doc > section > h2:first-child { margin-top: 48px; }
.steps > li { margin: 18px 0; }
.cmd { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 8px; }
.cmd h3 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; }
.group { font: 600 13px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin: 48px 0 0; }
.usage code { display: inline-block; padding: 6px 10px; }
.examples { list-style: none; padding: 0; }
.examples li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; }
.examples li code { background: none; padding: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.examples li span { color: var(--muted); font-size: 14px; }

/* diagrams and charts */
.diagram, .chart { width: 100%; height: auto; display: block; margin: 20px 0; }
.d-box { fill: var(--panel); stroke: var(--line); }
.d-store { fill: rgb(255 59 48 / .06); stroke: var(--accent); stroke-dasharray: 5 4; }
.d-hit { fill: rgb(125 220 154 / .10); stroke: var(--good); }
.d-in rect { fill: var(--panel); stroke: var(--line); }
.d-in text, .d-t { fill: var(--ink); font: 600 14px var(--mono); }
.d-s { fill: var(--muted); font: 12.5px var(--sans); }
.d-arrow { stroke: var(--muted); stroke-width: 1.6; fill: none; marker-end: url(#none); }
.chart text { font-family: var(--mono); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; }
.chart .val { fill: var(--ink); font-size: 11.5px; }
figure { margin: 0; }
figcaption { font: 12px var(--mono); color: var(--muted); }

/* benchmark page */
.callouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 36px 0; }
.callout { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.callout b { display: block; font: 800 clamp(34px, 4vw, 52px)/1 var(--display); color: var(--accent); margin-bottom: 10px; }
.callout.neutral b { color: var(--p1); }
.callout span { color: var(--muted); font-size: 15px; }
.local { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.local a { color: var(--muted); text-decoration: none; }
.local a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; }
  .callouts { grid-template-columns: minmax(0, 1fr); }
  .ref { display: block; overflow-x: auto; }
}

/* narrow screens: option and environment tables stack instead of crushing the description column */
@media (max-width: 640px) {
  .ref:not(.nums) thead { display: none; }
  .ref:not(.nums), .ref:not(.nums) tbody, .ref:not(.nums) tr, .ref:not(.nums) td { display: block; width: auto; }
  .ref:not(.nums) tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .ref:not(.nums) td { border: 0; padding: 3px 0; }
  .ref:not(.nums) td.flag { white-space: normal; width: auto; }
}
