
:root {
  --bg: #0d0f12;
  --surface: #15181e;
  --border: #252a34;
  --text: #e6e9ef;
  --muted: #949ba8;
  --accent: #7aa2f7;
  --accent-hover: #9bb8ff;
  --visited: #a79bf2;
  --radius: 6px;
  --max-width: 720px;
}

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

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

body {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 1.5rem 1.25rem 4rem;
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* Header & Navigation
   -------------------------------------------------------------------------- */

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-bottom: 1.25rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-title:hover {
  color: var(--accent);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
}

nav a:hover {
  color: var(--text);
}

nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* Typography & Semantic Content
   -------------------------------------------------------------------------- */

main {
  min-height: 55vh;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: clamp(1.6rem, 1.35rem + 1vw, 2rem);
  margin-top: 0;
}

h2 {
  font-size: 1.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.05rem;
}

p {
  margin-top: 0;
  margin-bottom: 1.1rem;
}

small,
time,
.meta {
  color: var(--muted);
  font-size: 0.875rem;
}

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

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

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

/* Lists & Definition Lists
   -------------------------------------------------------------------------- */

ul,
ol {
  margin-top: 0;
  margin-bottom: 1.25rem;
  padding-left: 1.35rem;
}

li + li {
  margin-top: 0.55rem;
}

dl {
  margin: 0 0 1.5rem;
}

dt {
  font-weight: 600;
  margin-top: 1rem;
}

dd {
  margin-left: 0;
  color: var(--muted);
}

/* Dividers, Callouts, Details (Native Pure-HTML Collapsibles)
   -------------------------------------------------------------------------- */

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

blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  background-color: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

details {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

details[open] summary {
  margin-bottom: 0.75rem;
}

/* Code & Tables
   -------------------------------------------------------------------------- */

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

code {
  background-color: var(--surface);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.5;
  margin: 1.25rem 0;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  display: block;
  overflow-x: auto;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Footer
   -------------------------------------------------------------------------- */

footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--text);
}

@media (max-width: 520px) {
  body {
    padding: 1.25rem 1rem 3rem;
  }

  header {
    margin-bottom: 1.75rem;
  }
}
