:root {
  color-scheme: dark;
  --bg: #0B0E14;
  --fg: #BFBDB6;
  --muted: #565B66;
  --accent: #E6B450;
  --blue: #59C2FF;
  --border: #1C212B;
  --gutter: clamp(1rem, 3vw, 2.5rem);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.7 'IBM Plex Sans', sans-serif;
}

a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: .2em;
}

a:hover { text-decoration-color: currentColor; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem var(--gutter);
}

header a {
  color: var(--accent);
  text-decoration: none;
}

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

header label { display: none; }
.menu-toggle:focus-visible ~ header label { outline: 1px solid var(--accent); outline-offset: 2px; }

nav.projects {
  padding: .6rem var(--gutter);
  background: var(--border);
}

nav a {
  color: var(--fg);
  text-decoration: none;
}

nav.projects a {
  color: var(--blue);
  opacity: .75;
}

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

nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

nav.projects a[aria-current="page"] {
  opacity: 1;
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: .15em;
}

.layout {
  display: grid;
  grid-template-columns: clamp(10rem, 14vw, 14rem) minmax(0, 1fr) clamp(10rem, 14vw, 14rem);
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: 0 var(--gutter);
  align-items: start;
}

#nav, .toc {
  position: sticky;
  top: 0;
}

#nav {
  padding: 2rem 0;
  font-size: .9375rem;
}

#nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#nav ul ul {
  margin-top: .3rem;
  padding-left: 1rem;
}

#nav li { margin: .3rem 0; }
#nav > ul > li + li { margin-top: .6rem; }

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 52rem) minmax(0, 1fr);
  min-width: 0;
  max-width: 72rem;
  justify-self: center;
  padding: 2rem 0;
  overflow-x: auto;
}

main > * { grid-column: 2; }
main > table { grid-column: 2 / -1; }

h1, h2, h3 {
  color: var(--fg);
  line-height: 1.3;
}

h1 {
  margin: 0 0 1.25rem;
  color: var(--accent);
  font-size: 1.875rem;
}

h2 {
  margin: 2.25rem 0 .75rem;
  font-size: 1.375rem;
}

h3 {
  margin: 1.75rem 0 .5rem;
  font-size: 1.125rem;
}

p, ul, ol, pre, blockquote, table { margin: 1.1rem 0; }
li + li { margin-top: .35rem; }

code, pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: .9em;
}

code {
  padding: .15em .35em;
  background: var(--border);
}

pre {
  padding: .75rem 1rem;
  border: 1px solid #242A36;
  overflow-x: auto;
  line-height: 1.6;
}

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

.toc {
  padding: 2rem 0;
  font-size: .875rem;
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc ul ul { padding-left: .75rem; }
.toc li { margin: .35rem 0; }

.toc a {
  display: inline-block;
  padding: .1rem 0;
  color: var(--fg);
  text-decoration: none;
}

.toc a:hover {
  color: var(--blue);
  text-decoration: underline;
}

blockquote {
  margin-left: 1rem;
  color: var(--muted);
}

table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .9375rem;
}

th, td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }

th {
  color: var(--muted);
  font-weight: 500;
}

tbody tr:last-child td { border-bottom: 0; }

hr {
  border: 0;
  margin: 2.5rem 0;
}

img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 72rem) {
  .layout { grid-template-columns: clamp(10rem, 14vw, 14rem) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 767px) {
  :root { --gutter: 1rem; }

  body {
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  header label {
    display: inline-block;
    color: var(--accent);
    font-size: .875rem;
    cursor: pointer;
  }

  .layout { grid-template-columns: minmax(0, 1fr); }
  #nav { display: none; position: static; }
  .menu-toggle:checked ~ .layout #nav {
    display: block;
    padding: 1rem 0;
  }

  main { padding: 1.5rem 0; }
  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.0625rem; }
}
