/* === FONT FACES === */

@font-face {
  font-family: 'SiteTitle';
  src: url('/fonts/mu-th-ur-Regular.otf') format('opentype');
  font-weight: normal;
}

@font-face {
  font-family: 'SiteTitle';
  src: url('/fonts/mu-th-ur-Regular.otf') format('opentype');
  font-weight: bold;
}

@font-face {
  font-family: 'SiteText';
  src: url('/fonts/mu-th-ur-Regular.otf') format('opentype');
  font-weight: normal;
}

@font-face {
  font-family: 'SiteText';
  src: url('/fonts/mu-th-ur-Regular.otf') format('opentype');
  font-weight: bold;
}

@font-face {
  font-family: 'SiteCode';
  src: url('/fonts/Hasklig-Light.otf') format('opentype');
  font-weight: normal;
}

@font-face {
  font-family: 'SiteCode';
  src: url('/fonts/Hasklig-Bold.otf') format('opentype');
  font-weight: bold;
}

/* === BASE === */

* {
  transition: background 0.2s ease, outline-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

:root {
  --site-text: 'SiteText', monospace;
  --site-title: 'SiteTitle', serif;
  --site-code: 'SiteCode', monospace;
  --site-font-size: 100%;
  --site-color: #1a1a1a;
  --site-code-bg: #ffd600;
  --site-code-outline: #f9a825;
}

html {
  font-size: var(--site-font-size);
  scroll-behavior: smooth;
}

body {
  font-family: var(--site-text);
  background-color: white;
  background-image: radial-gradient(circle, #ccc 1px, transparent 1px);
  background-size: 15px 15px;
  background-attachment: fixed;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
  line-height: 1.6;
  color: var(--site-color);
}

h1, h2, h3, h4 {
  font-family: var(--site-title);
  font-weight: normal;
  line-height: 1.2;
}

h1 { font-size: 50px; }
h2 { font-size: 40px; }
h3 { font-size: 30px; }
h4 { font-size: 20px; }

pre, code {
  background: var(--site-code-bg);
  color: var(--site-color);
  padding: 0;
  font-family: var(--site-text);
}

pre {
  overflow-x: auto;
  outline: 10px solid var(--site-code-bg);
  outline-offset: 0;
  margin-top: 10px;
  margin-bottom: 10px;
}

code {
  outline: 3px solid var(--site-code-bg);
  outline-offset: 0;
}

pre code {
  outline: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

.page-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  max-width: 800px;
  margin: 0 auto;
  padding: 30px 0;
}

aside.toc {
  flex: 0 0 25%;
  position: sticky;
  top: 1rem;
}

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

aside.toc li {
  margin-bottom: .4rem;
}

aside.toc a {
  color: var(--site-color);
  text-decoration: none;
  transition: background 0.2s ease, outline-color 0.2s ease;
}

aside.toc a:hover {
  background: var(--site-code-bg);
  outline: 3px solid var(--site-code-bg);
  outline-offset: 0;
}

aside.toc a.active {
  background: var(--site-code-bg);
  outline: 3px solid var(--site-code-bg);
  outline-offset: 0;
}

article {
  flex: 0 0 75%;
  min-width: 0;
  margin-bottom: 600px;
}

th, td {
  border: 1px solid #ddd;
  padding: .5rem 1rem;
  text-align: left;
}

th {
  background: #f4f4f4;
}

a { color: #0066cc; }

hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2rem 0;
}

nav { margin-bottom: 2rem; }
