/* Pixelbinder Blaupause - blueprint theme. Plain CSS, no build step.
   Restyle by changing the variables below first. */

:root {
  /* Colors */
  --paper:      #123f86;               /* blueprint blue (page background) */
  --panel:      #0b2c61;               /* calm panel behind running text */
  --ink:        #f3f8ff;               /* text on panel (contrast > 14:1) */
  --ink-soft:   #b9d2f5;               /* secondary text (contrast > 8:1) */
  --line:       #e6f0ff;               /* main line work */
  --line-soft:  rgba(230, 240, 255, .35);
  --accent:     #ffd45c;               /* links, focus, status */
  --grid-color: rgba(230, 240, 255, .09);
  --grid-major: rgba(230, 240, 255, .17);
  /* Grid */
  --grid: 24px;                        /* size of one grid cell */
  /* Fonts (system only, no downloads) */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  /* Alerts */
  --note: #8fc1ff;  --tip: #7be0a4;  --important: #cfa8ff;  --warning: #ffd45c;  --caution: #ff9a94;
  /* Layout */
  --width: 62rem;
}

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

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

body {
  margin: 0;
  color: var(--ink);
  font: 1.0625rem/1.65 var(--font-body);
  background-color: var(--paper);
  /* fine grid every cell, stronger line every 5 cells */
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size:
    calc(var(--grid) * 5) calc(var(--grid) * 5),
    calc(var(--grid) * 5) calc(var(--grid) * 5),
    var(--grid) var(--grid),
    var(--grid) var(--grid);
}

.page {
  max-width: var(--width);
  margin: 0 auto;
  padding: 1rem;
}

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

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

.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 10;
  background: var(--accent); color: #1a1400; padding: .5rem 1rem; font-weight: 700;
}
.skip-link:focus { top: .5rem; }

/* ---------- Header and navigation ---------- */

.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: .75rem 0 1rem;
  border-bottom: 2px solid var(--line);
  margin-bottom: 1.5rem;
}

.site-title {
  font: 700 1.25rem/1.2 var(--font-mono);
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
}

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.main-nav a {
  display: block; padding: .35rem .75rem;
  font: .9rem/1.3 var(--font-mono);
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--line-soft);
}
.main-nav a:hover { border-color: var(--line); background: rgba(255, 255, 255, .08); }
.main-nav a.active { border-color: var(--accent); color: var(--accent); background: var(--panel); }

/* CSS-only mobile menu: checkbox is hidden, label acts as button */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-button {
  display: none; padding: .4rem 1rem; cursor: pointer;
  font: .9rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em;
  border: 1px solid var(--line);
}
.nav-toggle:focus-visible + .nav-button { outline: 3px solid var(--accent); outline-offset: 3px; }

@media (max-width: 47.99rem) {
  .nav-button { display: inline-block; }
  .main-nav { display: none; flex-basis: 100%; }
  .nav-toggle:checked ~ .main-nav { display: block; }
  .main-nav ul { flex-direction: column; }
}

/* ---------- Sheet: the drawing frame around the content ---------- */

.sheet { position: relative; border: 2px solid var(--line); outline: 1px solid var(--line-soft); outline-offset: 5px; background: var(--panel); }

/* corner marks */
.sheet::before, .sheet::after {
  content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none;
  border: 3px solid var(--accent);
}
.sheet::before { top: -8px; left: -8px; border-right: 0; border-bottom: 0; }
.sheet::after  { bottom: -8px; right: -8px; border-left: 0; border-top: 0; }

.sheet-head { padding: 1.5rem 1.25rem 1rem; border-bottom: 1px solid var(--line-soft); }
.sheet-head h1 { margin: 0; }
.subtitle { margin: .5rem 0 0; color: var(--ink-soft); font-family: var(--font-mono); font-size: .95rem; }

h1, h2, h3, h4 { font-family: var(--font-mono); line-height: 1.25; color: var(--ink); overflow-wrap: break-word; hyphens: auto; }
h1 { font-size: clamp(1.6rem, 5vw, 2.4rem); letter-spacing: .01em; }

/* dimension-line decoration: heading text with a ruled line and end ticks */
.sheet-head h1::after {
  content: ""; display: block; height: 10px; margin-top: .75rem;
  border-left: 2px solid var(--accent); border-right: 2px solid var(--accent);
  background: linear-gradient(var(--accent), var(--accent)) center / 100% 2px no-repeat;
  max-width: 14rem;
}

.prose { padding: 1rem 1.25rem 1.5rem; max-width: 46rem; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose h2 { font-size: 1.4rem; margin: 2rem 0 .75rem; padding-bottom: .35rem; border-bottom: 1px dashed var(--line-soft); }
.prose h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; color: var(--accent); }
.prose h4 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin-bottom: .25rem; }
.prose li::marker { color: var(--accent); }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--line); padding: 4px; background: var(--paper); }
.prose hr { border: 0; height: 1px; margin: 2rem 0; background: var(--line-soft); }

.prose code {
  font: .9em var(--font-mono); padding: .1em .35em;
  background: rgba(255, 255, 255, .1); border: 1px solid var(--line-soft);
}

.prose blockquote {
  margin: 0 0 1rem; padding: .25rem 1rem; color: var(--ink-soft);
  border-left: 3px solid var(--line); background: rgba(255, 255, 255, .04);
}
.prose blockquote > :last-child { margin-bottom: 0; }

/* tables: scroll sideways on narrow screens instead of breaking the layout */
.prose table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
.prose th, .prose td { padding: .5rem .75rem; text-align: left; vertical-align: top; border: 1px solid var(--line-soft); }
.prose th { font-family: var(--font-mono); font-size: .9rem; background: rgba(255, 255, 255, .08); }

.button {
  display: inline-block; padding: .5rem 1.25rem; font-family: var(--font-mono);
  color: #1a1400; background: var(--accent); text-decoration: none; font-weight: 700;
}

/* ---------- Alerts (github-markdown-alerts plugin) ----------
   Markup: div.md-alert.md-alert--TYPE > p.md-alert-title + div.md-alert-body.
   Selectors are doubled (.md-alert.md-alert) to beat the plugin's own CSS. */

.md-alert.md-alert {
  --c: var(--note);
  margin: 0 0 1.25rem; padding: .75rem 1rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--c); border-left: 6px solid var(--c);
  color: var(--ink);
}
.md-alert--tip.md-alert--tip { --c: var(--tip); }
.md-alert--important.md-alert--important { --c: var(--important); }
.md-alert--warning.md-alert--warning { --c: var(--warning); border-style: dashed; border-left-style: solid; }
.md-alert--caution.md-alert--caution { --c: var(--caution); }

.md-alert.md-alert > .md-alert-title {
  color: var(--c); fill: var(--c); margin: 0 0 .5rem;
  font: 700 .85rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em;
}
.md-alert-body > :last-child { margin-bottom: 0; }

/* ---------- Footer: title block (Schriftfeld) ---------- */

.site-footer { margin-top: 2.5rem; display: flex; justify-content: flex-end; }

.title-block {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0;
  width: 100%; max-width: 34rem;
  background: var(--panel); border: 2px solid var(--line);
}
.title-block > div { padding: .4rem .75rem; border: 1px solid var(--line-soft); min-width: 0; }
.title-block dt { font: .7rem var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.title-block dd { margin: 0; font: 700 .95rem/1.3 var(--font-mono); overflow-wrap: anywhere; }
.title-block .status { color: var(--accent); }

@media (min-width: 40rem) {
  .title-block { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
