/*
 * JWKNT shared site foundation, version 1.
 *
 * This file owns the visual tokens and low-level patterns shared by the
 * JWKNT GitHub Pages projects. Site repositories load it before their local
 * stylesheet, so project-specific layouts can extend or override these rules.
 * Changes within v1 must remain backward compatible; breaking changes belong
 * in a new versioned directory.
 */

:root {
  --paper: #ffffff;
  --surface: #fafafa;
  --surface-blue: #eef2f7;
  --ink: #1a1a1a;
  --muted-strong: #444444;
  --muted: #666666;
  --faint: #888888;
  --line: #dcdcdc;
  --line-strong: #b8b8b8;
  --blue: #35507a;
  --blue-dark: #263c5e;
  --mark: #f4e9b8;
  --shadow: rgb(0 0 0 / 10%);
  --shadow-soft: rgb(0 0 0 / 8%);
  --serif: Georgia, "Times New Roman", "Source Serif Pro", serif;
  --mono: Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #121416;
  --surface: #181b1f;
  --surface-blue: #1c2734;
  --ink: #e8e4dc;
  --muted-strong: #c1bbb2;
  --muted: #aaa49b;
  --faint: #8f8a82;
  --line: #30343a;
  --line-strong: #4a5058;
  --blue: #93b4df;
  --blue-dark: #b8cff0;
  --mark: #5b4d22;
  --shadow: rgb(0 0 0 / 42%);
  --shadow-soft: rgb(0 0 0 / 30%);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: var(--blue);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blue-dark);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 6px 9px;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.skip-link:focus {
  top: 10px;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  width: min(1120px, calc(100% - 44px));
  margin-inline: auto;
  padding: 18px 0 8px;
  border-bottom: 1px solid var(--line);
}

.site-title {
  color: var(--ink);
  font-size: 22px;
  font-variant: small-caps;
  font-weight: 600;
  letter-spacing: .35px;
  line-height: 1.2;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 12px;
}

.site-header nav a {
  color: var(--muted);
}

.site-header nav a:hover {
  color: var(--blue-dark);
}

.site-header nav a[aria-current="page"] {
  color: var(--blue);
}

.theme-toggle {
  flex: none;
  min-width: 31px;
  min-height: 29px;
  margin-left: 4px;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1 var(--serif);
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
}

.theme-toggle:hover {
  border-color: var(--ink);
  background: var(--surface);
}

.theme-toggle:focus-visible {
  outline: 1px solid var(--blue);
  outline-offset: 3px;
}

.theme-toggle--floating {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 100;
  box-shadow: 0 2px 10px var(--shadow-soft);
}
