@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* Basic reset */
html {
  font-family: sans-serif;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background-color: #161616;
  color: #dfdfe0;
  line-height: 1.5;
  text-align: left; /* No justification */
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
}

@media (max-width: 400px) {
  body {
    font-size: 12px;
    margin: 10px;
  }
}

@media (min-width: 401px) and (max-width: 600px) {
  body {
    font-size: 14px;
    margin: 10px;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  body {
    font-size: 15px;
    margin: 20px 100px 25px 100px;
  }
}

@media (min-width: 901px) and (max-width: 1800px) {
  body {
    font-size: 17px;
    margin: 30px 200px 25px 200px;
    max-width: 800px;
  }
}

@media (min-width: 1801px) {
  body {
    font-size: 18px;
    margin: 30px 20% 25px 20%;
    max-width: 1000px;
  }
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  color: #78a9ff; /* Main accent blue */
  font-family: 'Inter', 'Segoe UI', sans-serif;
  padding-top: 0;
}

header > h1 {
  font-size: 2.5em;
  margin: 0;
  color: #78a9ff;
}

header > h2 {
  font-size: 1.8em;
  margin: 0;
  font-weight: 600;
  color: #78a9ff;
}

header > h3 {
  font-size: 1.2em;
  font-weight: 400;
  margin: 0;
  color: #08bdba; /* secondary teal accent */
}

/* Paragraphs */
p {
  margin-top: 1em;
  margin-bottom: 1em;
  color: #dfdfe0;
}

/* Links */
a, a:link, a:visited {
  color: #78a9ff;
  text-decoration: none;
  border-bottom: 1px dashed #78a9ff;
  transition: border-bottom-style 0.2s ease-in-out, color 0.2s ease-in-out;
}

a:hover, a:focus {
  border-bottom-style: solid;
  color: #be95ff; /* subtle highlight */
  outline: none;
}

/* Lists */
ul, ol {
  font-size: 90%;
  margin-top: 1em;
  margin-bottom: 1em;
  padding-left: 2em;
  color: #dfdfe0;
}

ul {
  list-style: disc;
}

ol {
  list-style: decimal;
}

/* Blockquotes */
blockquote {
  font-style: italic;
  font-size: 90%;
  border-left: 4px solid #78a9ff;
  margin-left: 0;
  margin-right: 0;
  padding-left: 1em;
  color: #be95ff;
  background-color: #282828;
  border-radius: 4px;
}

/* Code & Preformatted Text */
code {
  font-family: 'Source Code Pro', Consolas, Monaco, monospace;
  font-size: 0.9em;
  background-color: #282828;
  border: 1px solid #78a9ff;
  color: #78a9ff;
  padding: 0.15em 0.3em;
  border-radius: 4px;
  white-space: normal;
}

pre {
  background-color: #282828;
  border: 1px solid #78a9ff;
  border-radius: 8px;
  overflow-x: auto;
  padding: 1em 1.5em;
  margin: 1em 0;
  color: #dfdfe0;
  font-family: 'Source Code Pro', Consolas, Monaco, monospace;
  font-size: 0.9em;
  line-height: 1.4em;
}

/* Code blocks inside blockquote and lists inherit */
blockquote pre, ul pre, ol pre {
  margin-left: 0;
  margin-right: 0;
}

/* Tables */
table {
  width: 100%;
  margin-top: 1em;
  margin-bottom: 1em;
  border-collapse: collapse;
  border-spacing: 0;
  color: #dfdfe0;
  background-color: #282828;
  border: 1px solid #78a9ff;
  border-radius: 6px;
  overflow: hidden;
}

thead tr {
  background-color: #78a9ff;
  color: #161616;
  font-weight: 700;
}

tr {
  border-bottom: 1px solid #78a9ff;
}

tr.odd {
  background-color: #161616;
}

tr.even {
  background-color: #282828;
}

th, td {
  padding: 0.6em 1em;
  text-align: left;
}

/* Captions & figure */
caption, figcaption {
  font-size: 80%;
  font-style: italic;
  text-align: right;
  margin-bottom: 5px;
  color: #dfdfe0;
}

/* Images */
img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

/* Horizontal rule */
hr {
  border: 0;
  border-top: 1px solid #78a9ff;
  margin: 2em 0;
}

/* TOC Toggle: starts hidden */
#TOC input[type="checkbox"] {
  display: none;
}

#TOC label[for="contents"] {
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2em;
  margin-left: 0.5em;
  color: #78a9ff;
  transition: color 0.3s ease;
}

#TOC label[for="contents"]:hover {
  color: #be95ff;
}

/* Hide TOC list by default */
#TOC input[type="checkbox"] ~ ul {
  display: none;
}

/* Show TOC list when checkbox is checked */
#TOC input[type="checkbox"]:checked ~ ul {
  display: block;
}

/* Optional enhancements */
#TOC {
  background-color: #161616;
  border: 1px solid #78a9ff;
  padding: 1em 1.5em;
  margin-bottom: 2em;
  border-radius: 8px;
  color: #dfdfe0;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  max-width: 320px;
}

#TOC ul {
  list-style: none;
  padding-left: 1em;
}

#TOC ul ul {
  padding-left: 1.25em;
  border-left: 2px solid #08bdba;
  margin-left: 0.5em;
}

#TOC li {
  margin: 0.3em 0;
}

#TOC a {
  color: #78a9ff;
  text-decoration: none;
  border-bottom: 1px dashed #78a9ff;
}

#TOC a:hover,
#TOC a:focus {
  border-bottom-style: solid;
  color: #be95ff;
  outline: none;
}

/* Footnotes */
.footnotes {
  color: #dfdfe0;
  font-size: 70%;
  font-style: italic;
  margin-top: 3em;
  border-top: 1px solid #78a9ff;
  padding-top: 0.5em;
}

.footnotes li p:last-child a:last-child {
  border-bottom: none;
}

/* Remove background images from normalize */
body, code, tr.odd, tr.even, figure {
  background-image: none;
}

/* Button, input, and form styling (optional minimal style) */
button, input, select, textarea {
  background-color: #282828;
  border: 1px solid #78a9ff;
  color: #dfdfe0;
  font-family: inherit;
  font-size: 1em;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

button:hover, input:hover, select:hover, textarea:hover {
  background-color: #78a9ff;
  color: #161616;
  cursor: pointer;
}

/* Scrollbar styling for code blocks */
pre::-webkit-scrollbar {
  height: 8px;
}

pre::-webkit-scrollbar-track {
  background: #161616;
}

pre::-webkit-scrollbar-thumb {
  background-color: #78a9ff;
  border-radius: 4px;
}

