/* kernloop static site — dependency-free, system fonts only, dark + light. */

:root {
  --bg: #ffffff;
  --fg: #1a1c1f;
  --muted: #545a62;
  --rule: #d9dde2;
  --accent: #0a5ad6;
  --accent-fg: #ffffff;
  --code-bg: #f0f2f5;
  --code-fg: #1a1c1f;
  --chip-bg: #eef1f6;
  --chip-fg: #0a4cb0;
  --chip-border: #c8d2e2;
  --max: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --fg: #e7eaee;
    --muted: #a6adb6;
    --rule: #2b2f36;
    --accent: #6fa8ff;
    --accent-fg: #0c0e12;
    --code-bg: #1f242b;
    --code-fg: #e7eaee;
    --chip-bg: #1c2230;
    --chip-fg: #9cc2ff;
    --chip-border: #33415c;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

code, .loop, .clm, .clm-sample, .wordmark {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.5rem 0.9rem;
  border-radius: 0 0 6px 0;
  z-index: 10;
}
.skip-link:focus { left: 0; }

a { color: var(--accent); }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- header ---- */
.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.4rem 1.25rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
  justify-content: space-between;
}
.wordmark {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.95rem;
}
.site-header nav a { text-decoration: none; }

/* In-prose links are underlined at rest (WCAG 1.4.1 — not color alone).
   Nav, button, CLM chips, and skip-link are delineated by shape/layout. */
main a:not(.button):not(.clm),
.site-footer a:not(.clm) {
  text-decoration: underline;
}

/* ---- main ---- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

section { padding-top: 2.75rem; }

.hero { padding-top: 2rem; }

h1 {
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 1rem;
}
h2 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
}
h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.4rem;
}

.lede {
  font-size: 1.2rem;
  color: var(--fg);
}

.muted { color: var(--muted); }

p { margin: 0.75rem 0; }

/* ---- button ---- */
.cta { margin-top: 1.5rem; }
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.button:hover { text-decoration: underline; }

/* ---- code ---- */
code {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.loop {
  display: block;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  line-height: 2;
  font-size: 0.92rem;
}
.loop code { background: transparent; padding: 0; }

/* ---- command block ---- */
.commands {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin: 0.75rem 0;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.7;
}
.commands code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

/* ---- lists ---- */
ul { padding-left: 1.3rem; }
ul.contracts, ul.faculties {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
ul.contracts li code { font-size: 0.95rem; }
ul.faculties li {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.95rem;
}
ul.tiers li { margin: 0.3rem 0; }

/* ---- CLM chips ---- */
.claim-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0 0.25rem;
}
.clm {
  display: inline-block;
  background: var(--chip-bg);
  color: var(--chip-fg);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}
.clm:hover { text-decoration: underline; }
.clm-sample {
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  font-size: 0.8rem;
  color: var(--chip-fg);
}

/* ---- footer ---- */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .point-in-time {
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* ---- 404 ---- */
.notfound {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 1.25rem;
  text-align: center;
}
