/* Minimal, readable, static site styling (no JS). */

:root {
  color-scheme: dark;
  /* Matches http://djlink.sarmad.no/ */
  --bg: #0f1527;
  --panel: #1a2036;
  --text: #dfe6f3;
  --muted: rgba(223, 230, 243, 0.72);
  --accent: #7fe1ce;
  --border: rgba(223, 230, 243, 0.14);
  --soft: rgba(223, 230, 243, 0.08);
  --soft2: rgba(223, 230, 243, 0.06);
  --shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, Inter, ui-sans-serif, system-ui, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}

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

a:hover {
  opacity: 0.9;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidenav {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 26px 18px;
  border-right: 1px solid var(--border);
  background: var(--panel);
}

.sidenav__title {
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 18px;
}

.sidenav__link {
  display: block;
  padding: 8px 10px;
  margin: 2px 0;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
}

.sidenav__link:hover {
  background: var(--soft);
}

.content {
  padding: 40px 28px 72px;
  max-width: 980px;
  margin: 24px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
}

.page-footer {
  margin-top: auto;
  padding-top: 18px;
}

.page-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}

.page-header__h1 {
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.2px;
}

.page-header__sub {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.section {
  padding: 18px 0;
}

.section h2 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -0.1px;
}

.section p {
  margin: 10px 0;
  max-width: 80ch;
}

.diagram {
  margin: 16px 0 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(223, 230, 243, 0.92);
}

.diagram img {
  display: block;
  width: 100%;
  height: auto;
}

.diagram figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.kv {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.kv__item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel);
}

.kv__k {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.kv__v {
  font-size: 14px;
}

.callout {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
  background: var(--panel);
}

.callout__title {
  font-weight: 600;
  margin-bottom: 10px;
}

.code {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--soft2);
  overflow: auto;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

.list {
  margin: 0;
  padding-left: 18px;
}

.footer-note {
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 0;
  text-align: center;
  width: 100%;
}

@media (max-width: 480px) {
  /* Mobile phones */
  .layout {
    grid-template-columns: 1fr;
  }

  .sidenav {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }

  .sidenav__title {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .sidenav__link {
    padding: 12px 8px;
    font-size: 15px;
    margin: 1px 0;
  }

  .content {
    padding: 20px 16px 40px;
    margin: 8px;
    min-height: auto;
  }

  .page-header__h1 {
    font-size: 24px;
  }

  .page-header__sub {
    font-size: 14px;
    line-height: 1.4;
  }

  .section h2 {
    font-size: 16px;
  }

  .section p {
    font-size: 14px;
    line-height: 1.5;
  }

  .diagram {
    padding: 8px;
    margin: 12px 0;
  }

  .callout {
    padding: 12px;
    margin: 10px 0;
  }

  .callout__title {
    font-size: 14px;
  }

  .kv {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .kv__item {
    padding: 10px;
  }

  .list {
    padding-left: 16px;
  }

  .footer-note {
    font-size: 12px;
  }

  .page-footer {
    padding-top: 12px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  /* Tablets */
  .layout {
    grid-template-columns: 1fr;
  }

  .sidenav {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 20px;
  }

  .sidenav__link {
    padding: 10px;
    font-size: 16px;
  }

  .content {
    padding: 32px 24px 56px;
    margin: 12px;
    min-height: auto;
  }

  .page-header__h1 {
    font-size: 28px;
  }

  .kv {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* Large tablets / small laptops */
  .layout {
    grid-template-columns: 240px 1fr;
  }

  .content {
    margin: 16px;
    padding: 36px 24px 64px;
  }

  .kv {
    grid-template-columns: repeat(3, 1fr);
  }
}
