/* The stylesheet of https://oskalang.dev. `site/build.osk` copies it to
   `_site/style.css`. Fonts come from the pinned Fontsource CSS each page
   links, with system fonts behind them. No inline styles: the CSP allows
   none. The only script is `search.js`, which adds the search box and the
   Copy button. */

:root {
  --text: #1d2125;
  --muted: #5b6470;
  --background: #ffffff;
  --surface: #f4f5f7;
  --border: #dde1e6;
  --accent: #0b5cad;
  --code: #f4f5f7;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e3e6ea;
    --muted: #a1a9b3;
    --background: #14171a;
    --surface: #1d2125;
    --border: #30363d;
    --accent: #6cb4ff;
    --code: #1d2125;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 100%;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

header,
main,
footer {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

header {
  border-bottom: 1px solid var(--border);
}

aside {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

aside p {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.4rem 1.25rem;
}

.search {
  position: relative;
  padding-bottom: 0.75rem;
}

.search input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  font: inherit;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.search-results {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.search-results[hidden] {
  display: none;
}

.search-results li {
  padding: 0.25rem 0.75rem;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 1rem 0;
  list-style: none;
}

nav li:first-child a {
  font-weight: 700;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--text);
}

nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

main {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  padding-bottom: 2rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
  font-weight: 700;
}

h1 {
  font-size: 2rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.2rem;
}

h4,
h5,
h6 {
  font-size: 1rem;
}

a {
  color: var(--accent);
}

p,
ul,
ol,
pre,
table,
blockquote {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.5rem;
}

li > ul,
li > ol {
  margin-bottom: 0;
}

li > p {
  margin-bottom: 0.5rem;
}

code,
pre {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}

code {
  background: var(--code);
  border-radius: 4px;
  padding: 0.1em 0.3em;
}

pre {
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.875rem 1rem;
  overflow-x: auto;
  line-height: 1.45;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

blockquote {
  border-left: 4px solid var(--border);
  color: var(--muted);
  padding: 0 1rem;
  margin-left: 0;
}

blockquote > :last-child {
  margin-bottom: 0;
}

table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  max-width: 100%;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface);
}

img {
  max-width: 100%;
}

/* The agent-setup prompt: a block with a Copy button (which `search.js`
   shows), and the prompt as text that wraps and scrolls on its own. */

.agent-setup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1.5rem 0;
  padding: 0 1.25rem 0.25rem;
}

.agent-setup h2 {
  border-bottom: 0;
  margin-top: 1rem;
}

.agent-setup pre {
  max-height: 24rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agent-setup button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: var(--background);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.35rem 1rem;
}

.agent-setup button:hover {
  opacity: 0.9;
}
