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

:root {
  --content-max-width: 820px;
}

html,
body,
.sidebar,
.page,
.content,
.menu-bar {
  font-family: "Geist Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.light,
.rust,
.coal,
.navy,
.ayu {
  --content-max-width: 820px;
}

.light {
  --bg: #ffffff;
  --sidebar-bg: #ffffff;
  --theme-popup-bg: #ffffff;
}

.navy,
.coal,
.ayu {
  --bg: #101010;
  --sidebar-bg: #101010;
  --theme-popup-bg: #101010;
}

body {
  background: var(--bg);
}

.sidebar,
.sidebar-resize-handle,
#mdbook-sidebar-toggle,
#mdbook-search-toggle,
.menu-title,
.menu-bar .right-buttons,
.menu-bar,
.nav-wide-wrapper,
.nav-wrapper {
  display: none !important;
}

.page-wrapper {
  margin-left: 0 !important;
}

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  height: 72px;
  border-bottom: 1px solid var(--table-border-color);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2.2rem;
  box-sizing: border-box;
  width: min(100%, 1120px);
  height: 100%;
  margin: 0 auto;
  padding: 0 2rem;
}

.site-brand {
  flex: none;
  color: var(--fg) !important;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.75rem, 1.8vw, 1.6rem);
  white-space: nowrap;
}

.site-nav a {
  color: var(--fg) !important;
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--links);
  text-underline-offset: 0.35em;
}

.site-theme-toggle {
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: Arial, sans-serif;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.site-theme-toggle:hover,
.site-theme-toggle:focus-visible {
  outline: 1px solid var(--table-border-color);
  outline-offset: 2px;
}

#mdbook-menu-bar-hover-placeholder {
  display: none;
}

.content main {
  max-width: var(--content-max-width);
  padding-top: 10rem;
  padding-bottom: 5rem;
}

h1,
h2,
h3 {
  font-weight: 750;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.35rem);
  line-height: 1.08;
}

h2 {
  margin-top: 2.6rem;
  font-size: 1.45rem;
}

h3 {
  margin-top: 2rem;
  font-size: 1.08rem;
}

p,
li {
  line-height: 1.75;
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

blockquote {
  border-left-width: 2px;
  font-style: normal;
}

@media (max-width: 900px) {
  .site-header {
    height: 104px;
  }

  .site-header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.8rem 1rem;
    padding: 1rem 1.2rem 0.8rem;
  }

  .site-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .site-theme-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    width: 100%;
    gap: 0.4rem;
    padding-bottom: 0.7rem;
  }

  .site-nav a {
    font-size: clamp(1.05rem, 3.4vw, 1.2rem);
  }

  .content main {
    padding-top: 13.5rem;
  }
}

@media (max-width: 400px) {
  .site-header-inner {
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .site-nav {
    gap: 0.2rem;
  }

  .site-nav a {
    font-size: 1rem;
  }
}
