/* Keystroke site styles, shared by index.html, manual.html and compare.html.
   Colours follow the Keystroke mark (navy, gold in dark mode). Everything is served from this folder:
   no scripts, no third party requests. Layout rules follow the portfolio's responsive standard: grids
   that can shrink, wide tables scroll inside their own box, the page never scrolls sideways. */
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url("inter-400.ttf"); }
@font-face { font-family: Inter; font-weight: 500 700; font-display: swap; src: url("inter-500.ttf"); }
:root {
  --bg: #F8F9FA; --surface: #FFFFFF; --ink: #07090D; --ink2: #3D4350; --muted: #56657A;
  --rule: #DDE1E7; --accent: #1C3557; --onAccent: #FFFFFF; --soft: #E8EFF7; --chip: #F3EBDD; --chipInk: #6E531F;
  --code: #F0F2F5; --warn: #7A520C; --warnSoft: #F5EEDC;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #07090D; --surface: #111820; --ink: #F8F9FA; --ink2: #C9C4BA; --muted: #8A97AB;
    --rule: #222A36; --accent: #C8A96E; --onAccent: #07090D; --soft: #1A2230; --chip: #1C2433; --chipInk: #C8D4E6;
    --code: #0C1018; --warn: #D9A24E; --warnSoft: #2B220E; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 Inter, system-ui, "Segoe UI", sans-serif; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }

header.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; }
.brand span { font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
nav.site { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-left: auto; font-size: 16px; }
nav.site a { text-decoration: none; color: var(--ink2); padding: 4px 0; border-bottom: 2px solid transparent; }
nav.site a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

h1 { font-size: clamp(30px, 5.5vw, 50px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 18px; max-width: 18ch; }
h2 { font-size: 26px; letter-spacing: -0.01em; margin: 48px 0 14px; }
h3 { font-size: 19px; margin: 32px 0 8px; }
p, li { color: var(--ink2); }
.lead { font-size: clamp(18px, 2.4vw, 21px); max-width: 46ch; margin: 0 0 28px; }
.hero { padding: 40px 0 24px; }
section { padding-bottom: 8px; }

.demo { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 10px; padding: 12px 16px; font-size: 16px; max-width: 100%; }
kbd, .key { font: 500 15px/1 "Cascadia Mono", Consolas, monospace; background: var(--chip); color: var(--chipInk);
  padding: 4px 7px; border-radius: 5px; white-space: nowrap; }
.muted { color: var(--muted); }

.shot { margin: 36px 0 8px; border-radius: 12px; overflow: hidden; border: 1px solid var(--rule);
  box-shadow: 0 12px 40px rgba(7, 9, 13, 0.12); }
.shot img { display: block; width: 100%; height: auto; }
.caption { color: var(--muted); font-size: 14px; margin: 0 0 24px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 20px 22px; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0; font-size: 16px; }
.card a { font-weight: 500; }

.note { background: var(--soft); border-radius: 10px; padding: 16px 20px; max-width: 76ch; font-size: 16px; }
.note p { margin: 0 0 8px; } .note p:last-child { margin: 0; }
.warn { background: var(--warnSoft); border-left: 4px solid var(--warn); border-radius: 6px; padding: 12px 16px;
  max-width: 76ch; font-size: 16px; color: var(--ink); }

/* Manual: a contents list, then one block per feature. */
.toc { columns: 2 240px; column-gap: 32px; padding-left: 20px; margin: 0 0 8px; }
.toc li { margin-bottom: 4px; break-inside: avoid; }
.example { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; margin: 12px 0 8px; }
.example > div { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.example .label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 6px; }
.result { white-space: pre-wrap; margin: 0; color: var(--ink); }
pre { margin: 0; overflow-x: auto; background: var(--code); border-radius: 8px; padding: 12px 14px;
  font: 14px/1.5 "Cascadia Mono", Consolas, monospace; color: var(--ink); }

/* Tables scroll inside their own box on narrow screens. */
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); margin: 12px 0 8px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
tr:last-child td { border-bottom: 0; }
th { font-weight: 600; background: var(--soft); color: var(--ink); }
td code, p code, li code { font: 14px "Cascadia Mono", Consolas, monospace; background: var(--code); padding: 1px 5px; border-radius: 4px; }
.compare td:first-child, .compare th:first-child { font-weight: 600; color: var(--ink); min-width: 150px; }
.compare td, .compare th { min-width: 190px; }

footer { border-top: 1px solid var(--rule); margin-top: 56px; padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
footer p { color: var(--muted); margin: 0 0 6px; }

@media (max-height: 480px) and (orientation: landscape) { .hero { padding-top: 16px; } }
.button { display: inline-block; background: var(--accent); color: var(--onAccent); text-decoration: none;
  font-weight: 600; padding: 12px 22px; border-radius: 8px; margin-right: 10px; }
.button:hover { filter: brightness(1.08); }
