@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;500;700&display=swap');

/* // base
///////////////////// */

:root {
  --bg-color: #fff;
  --font-color: #121212;
  --switch-color: #fbf7f5;
  --sun-color: #FFD700;
  --highlight-color: #eee;
  --default-transition: all 300ms ease-in;
  --link-color: #15141a;
  font-weight: 500;
}
:root.dark-theme {
  --bg-color: #121212;
  --font-color: #fbf7f5;
  --highlight-color: #262626;
  --switch-color: #5e5e5e;
  font-weight: 300;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}
body {
  background: var(--bg-color);
  color: var(--font-color);
  display: flex;
  font-size: 2rem;
  font-family: 'Open Sans', sans-serif;
  line-height: 1.55;
  position: relative;
  transition: var(--default-transition);
}
a:link,
a:visited {
  /* color: #74a9f6; */
  text-decoration: none;
}
header {
  font-weight: 700;
}
p:not(:last-of-type) {
  margin-bottom: 2rem;
}

/* // dark mode toggle
///////////////////// */

.dark-mode-toggler {
  position: absolute;
  top: 3rem;
  right: 4rem;
}

.dark-mode-toggler #checkbox-dark {
  position: absolute;
  opacity: 0;
}

.dark-mode-toggler > .label {
  width: 5.3rem;
  height: 2.8rem;
  background-color: var(--bg-color);
  border: 2px solid var(--highlight-color);
  border-radius: 5rem;
  padding: .5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  transform: scale(1.5);

}

.dark-mode-toggler .switcher {
  width: 2rem;
  height: 2rem;
  background-color: var(--switch-color);
  position: absolute;
  top: .2rem;
  left: .2rem;
  border-radius: 50%;
  transition: var(--default-transition);
}

.dark-mode-toggler #checkbox-dark:checked + .label .switcher {
  transform: translateX(24px);
}

svg.sun-icon {
  fill: var(--sun-color);
}
svg.moon-icon {
  fill: var(--font-color);
}

/* // scrollbars
///////////////////// */

* {
  scrollbar-width: thin;
  scrollbar-color: lightgray transparent;
}

*::-webkit-scrollbar {
  width: 12px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: lightgray;
  border-radius: 2rem;
}

/* // navigation
///////////////////// */

#navbar {
  border-right: 3px solid gray;
  flex: 0 0 290px;
  font-size: 1.7rem;
  height: 100vh;
  overflow-y: auto;
}

#navbar header {
  font-size: 3rem;
  text-align: center;
  padding: 2rem 1rem;
}

.nav-link {
  text-decoration: none;
  border-top: 1px solid gray;
  color: inherit;
  display: inline-block;
  padding: 1rem 2rem;
  width: 100%;
  transition: background-color 200ms;
}

.nav-link:hover {
  background-color: var(--highlight-color);
}

.nav-link:last-child {
  border-bottom: 1px solid gray;
}

/* // sections
///////////////////// */

.main-section {
  padding: 0 2rem;
  max-width: 120rem;
}

.main-section:last-child {
  margin-bottom: 3rem;
}

.main-section header {
  font-family: 'Montserrat', sans-serif;
  font-size: 3rem;
  margin: 2rem 0;
  display: flex;
}

.main-section header span {
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 200ms;
}

.main-section header:hover span {
  opacity: 1;
}

.main-section header svg {
  width: 2.5rem;
  height: 2.5rem;
  margin-left: .5rem;
  fill: gray;
  transition: fill 200ms;
}

.main-section header svg:hover {
  cursor: pointer;
  fill: #333333;
}

/* // code
///////////////////// */

pre {
  border-radius: .5rem;
  margin: 3rem 0 !important;
}
code {
  display: block;
  font-size: .9em;
  background: var(--highlight-color);
  white-space: pre;
}

code:not([class=language-js]) {
  display: inline;
  padding: .2rem .7rem;
  border-radius: .2rem;
}

kbd {
  border: .3rem solid var(--highlight-color);
  padding: .2rem 1rem;
  border-radius: .5rem;
}

/* // lists
///////////////////// */

ul:not(ul ul){
  margin: 3rem 0 3rem 5rem;
}

ul ul {
  margin-left: 5rem;
}

li {
  padding: .5rem 0;
}

/* // media queries
///////////////////// */

@media (max-width: 900px) {
  body {
    flex-flow: column nowrap;
  }
  #navbar {
    border: none;
  }
  #navbar-links {
    border-top: 2px solid gray;
    border-bottom: 2px solid gray;
    height: 250px;
  }
}
@media (min-width: 900px) {
  #navbar {
    position: sticky;
    top: 0;
  }
}
