:root {
  --bg: #f7f4ed;
  --paper: #fffdf8;
  --ink: #111111;
  --muted: #49505b;
  --accent: #0d47a1;
  --accent-soft: #e9eef8;
  --line: #181818;
  --bauhaus-red: #c62b25;
  --bauhaus-yellow: #f3c316;
  --bauhaus-blue: #0d47a1;
  --shadow: 0 10px 0 rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", serif;
  --font-sans: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono:
    "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-serif);
  font-size: clamp(1.03rem, 0.98rem + 0.25vw, 1.13rem);
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

header,
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.1rem;
}

.site-header {
  margin-top: 1.2rem;
}

main {
  margin-top: 2rem;
  margin-bottom: 3.6rem;
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
  color: var(--accent);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.85rem, 1.62rem + 1.1vw, 2.45rem);
  text-wrap: balance;
}

h2 {
  margin: 0.1rem 0 0.75rem;
  font-size: clamp(1.28rem, 1.18rem + 0.5vw, 1.58rem);
}

h3 {
  margin: 1.35rem 0 0.55rem;
  font-size: clamp(1.08rem, 1.02rem + 0.32vw, 1.26rem);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

nav {
  font-family: var(--font-sans);
  display: inline-flex;
  gap: 0.45rem;
  padding: 0.4rem;
  border: 2px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.1);
}

nav a {
  text-decoration: none;
  padding: 0.35rem 0.72rem;
  border-radius: 0;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
}

nav a:hover,
nav a:focus-visible {
  background: var(--bauhaus-yellow);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #111;
  color: #fff;
  padding: 0.5rem 0.75rem;
}

.skip-link:focus {
  top: 0;
}

.lede {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 1.03em;
}

.topline,
.meta,
.cqja-number,
label,
input,
.note-tags a,
.tag-cloud a {
  font-family: var(--font-sans);
}

p,
ul,
ol,
blockquote,
pre {
  margin-top: 0;
  margin-bottom: 1.05rem;
}

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

li {
  margin-bottom: 0.32rem;
}

main p,
main li {
  max-width: 70ch;
}

blockquote {
  margin-left: 0;
  padding: 0.2rem 0 0.2rem 0.9rem;
  border-left: 3px solid var(--line);
  color: #2e3947;
  font-style: italic;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code {
  padding: 0.08rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f2f5fb;
}

pre {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f2f5fb;
  overflow-x: auto;
}

.panel {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.9rem;
  box-shadow: var(--shadow);
}

.home-grid {
  display: grid;
  gap: 1.25rem;
}

.theme-terminal-home {
  margin-top: 0.35rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.1);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.52rem 0.8rem;
  border-bottom: 2px solid var(--line);
  background: #f6f7f9;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--muted);
}

.terminal-bar .dot {
  width: 9px;
  height: 9px;
  border-radius: 0;
  background: #9aa6b8;
}

.terminal-bar .dot:nth-child(1) {
  background: var(--bauhaus-red);
}

.terminal-bar .dot:nth-child(2) {
  background: var(--bauhaus-yellow);
}

.terminal-bar .dot:nth-child(3) {
  background: var(--bauhaus-blue);
}

.terminal-shell {
  padding: 1rem;
}

.terminal-panel {
  border-radius: 10px;
}

.terminal-label {
  margin: 0 0 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.terminal-title {
  font-family: var(--font-sans);
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.terminal-title:hover {
  text-decoration: underline;
}

.terminal-meta {
  font-family: var(--font-sans);
}

.terminal-note-item {
  border-bottom-style: dashed;
}

.terminal-grid .note-content {
  font-family: var(--font-serif);
}

@media (min-width: 860px) {
  .home-grid {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

.home-notes,
.tag-cloud,
.note-tags {
  list-style: none;
  padding: 0;
  margin: 0;
}

.note-item {
  padding-bottom: 0.8rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px dashed var(--line);
}

.note-item:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.home-notes small {
  display: block;
  color: var(--muted);
  margin-top: 0.08rem;
}

.note-content {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.note-content > *:first-child {
  margin-top: 0;
}

.note-content p,
.note-content li {
  max-width: none;
}

.cqja-number {
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.44rem;
  margin: 0.65rem 0 0;
}

.note-tags a,
.tag-cloud a {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
}

.note-tags a:hover,
.tag-cloud a:hover {
  background: var(--bauhaus-yellow);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

label,
input {
  display: block;
}

input[type="search"] {
  margin: 0.4rem 0 1.1rem;
  padding: 0.58rem 0.65rem;
  width: min(100%, 27rem);
  border: 2px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0 1.2rem;
}

.cqja-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
