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

html {
  scroll-behavior: smooth;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  cursor: default;
}

body {
  margin: 0;
  min-height: 100vh;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0.75rem 2rem;
  background: var(--bg-color, #fff);
  border-bottom: 1px solid var(--borders, #e6ecf1);
}

.topnav nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.topnav a {
  color: var(--control-text-color, #3b454e) !important;
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 0.3rem;
}

.topnav a.brand {
  padding-left: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading-text-color, #242a31) !important;
}

.topnav a:hover {
  background: var(--item-hover-bg-color, #f5f7f9);
  color: var(--item-hover-text-color, #242a31) !important;
}

.topnav a.active {
  color: var(--primary-color, rgb(56, 132, 255)) !important;
}

.topnav a:not([href]) {
  color: var(--light-text-color-darker, #74818d) !important;
  cursor: default;
}

.topnav a:not([href]):hover {
  background: transparent;
}

#write {
  max-width: 850px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
  width: 100%;
}

.page-hero {
  margin-bottom: 3rem;
}

.page-hero h1,
.article-header h1 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  border-bottom: none;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--primary-color, rgb(56, 132, 255));
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede,
.article-meta {
  margin: 0;
  color: var(--light-text-color-darker, #74818d);
  font-size: 1.05rem;
}

.note-group {
  margin-bottom: 2.75rem;
}

.note-group h2 {
  margin: 0 0 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--borders, #e6ecf1);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--light-text-color-darker, #74818d);
}

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

.note-list li + li {
  border-top: 1px solid var(--borders, #e6ecf1);
}

.note-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0.15rem;
  color: var(--heading-text-color, #242a31) !important;
}

.note-list a:hover .note-title {
  color: var(--primary-color, rgb(56, 132, 255));
}

.note-title {
  font-weight: 500;
  transition: color 0.2s ease;
}

.note-list time {
  flex-shrink: 0;
  color: var(--light-text-color, #9daab6);
  font-size: 0.85rem;
}

.back-link {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}

.article-header {
  margin-bottom: 2.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--borders, #e6ecf1);
}

.article-body {
  overflow-wrap: break-word;
}

.article-body > h1:first-child,
.article-body > h2:first-child {
  margin-top: 0;
}

.article-body img,
#write img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--borders, #e6ecf1);
  border-radius: 0.4rem;
}

.article-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

pre,
pre[class*="language-"] {
  margin: 1.5rem 0;
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  background: var(--codeboxes, #183055) !important;
  border-radius: 0.35rem;
  font-family: "Source Code Pro", ui-monospace, monospace;
  font-size: 0.85rem;
  line-height: 1.65;
}

pre code,
pre code[class*="language-"] {
  padding: 0;
  background: transparent !important;
  color: inherit;
  font-size: inherit;
  box-shadow: none;
}

code {
  font-family: "Source Code Pro", ui-monospace, monospace;
}

@media (max-width: 720px) {
  .topnav {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
  }

  .note-list a {
    flex-direction: column;
    gap: 0.2rem;
  }
}
