/* DSA notes — monochrome, mobile-first, no framework needed */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fafaf9;
  color: #18181b;
  font-family: "Geist", -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.back {
  display: inline-block;
  font-size: 13px;
  color: #71717a;
  text-decoration: none;
  font-family: "Roboto Mono", monospace;
}
.back:hover {
  color: #18181b;
}

.eyebrow {
  margin: 20px 0 4px;
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #71717a;
}

h1 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.lede {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.55;
  color: #3f3f46;
}

h2 {
  margin: 32px 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  padding-bottom: 8px;
  border-bottom: 1px solid #e4e4e7;
}

p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.6;
  color: #27272a;
}

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

li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 14.5px;
  line-height: 1.55;
  color: #27272a;
}
li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a1a1aa;
}

.complexity {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.complexity-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #e4e4e7;
}
.complexity-row:last-child {
  border-bottom: none;
}
.complexity-label {
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  color: #18181b;
  white-space: nowrap;
}
.complexity-desc {
  font-size: 13px;
  color: #52525b;
  text-align: right;
}

pre {
  margin: 0;
  padding: 16px;
  border-radius: 10px;
  background: #18181b;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
code {
  font-family: "Roboto Mono", monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: #e4e4e7;
  white-space: pre;
}

/* Syntax highlighting — muted, low-saturation to stay readable and calm */
.tok-comment {
  color: #71717a;
  font-style: italic;
}
.tok-string,
.tok-template {
  color: #9ece6a;
}
.tok-keyword {
  color: #7aa2f7;
}
.tok-number {
  color: #ff9e64;
}
.tok-builtin {
  color: #bb9af7;
}
.tok-func {
  color: #7dcfff;
}

.footer-nav {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e4e4e7;
}

/* --- Index page --- */
.index-header {
  margin-bottom: 8px;
}
.index-count {
  font-family: "Roboto Mono", monospace;
  font-size: 12px;
  color: #a1a1aa;
}
.toc-category {
  margin: 30px 0 12px;
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #71717a;
}
.toc-category:first-of-type {
  margin-top: 24px;
}
.toc-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #e4e4e7;
}
.toc-item {
  display: block;
  padding: 14px 2px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #e4e4e7;
}
.toc-item:active {
  background: #f4f4f5;
}
.toc-title {
  font-size: 15px;
  font-weight: 500;
  color: #18181b;
}
.toc-oneliner {
  margin-top: 2px;
  font-size: 13px;
  color: #71717a;
  line-height: 1.4;
}

@media (min-width: 640px) {
  .wrap {
    padding: 48px 32px 100px;
  }
  h1 {
    font-size: 32px;
  }
  .toc-item:hover {
    background: #f4f4f5;
  }
}
