/*layout and basic design*/

body {
  margin: 0 10% 0 10%;
  padding: 0 0 0 0;
  background-color: #bbb;
  font-family: sans-serif;
}

header, #content, footer {
  position: relative;
  box-shadow: 0px 5px 5px #999;
}

#content {
  height: auto;
  overflow-y: hidden;
}

#content > * {
  padding: 10px 30px 10px 30px;
}

header {
  margin: 0 0 10px 0;
  padding: 30px 0 10px 0;
  background-color: #000;
  background-image: url("/assets/images/banner.png");
  color: #fff;
  text-align: center;
}

header {
  text-transform: uppercase;
}

main, aside, #content {
  height: auto;
  min-height: 100%;
}

main {
  background-color: #fff;
}

main:not(.nonav) { /*allows disabling sidebar on main page*/
  margin-left: 20%;
}

main h2 {
  width: 100%;
  padding-bottom: 0.25em;
  border-bottom: 1px solid #bbb;
}

aside{
  color: #fff;
  background-color: #ddd;
}

aside ul, nav#top ul {
  list-style-type: none;
  text-indent: 0;
}

aside ul {
  padding-left: 0;
}

nav#top {
  background-color: rgba(255,255,255,0.867); /*will display as #ddd on a black background*/
}

nav#top ul {
  padding: 5px;
}

aside li {
  border-bottom: 1px solid #bbb;
  margin-bottom: 0.5em;
}

nav#top li {
  display: inline;
  margin: 0;
  padding: 1px 8px 1px 8px;
}

nav#top a {
  color: #fff;
}

footer {
  background-color: #000;
  background-image: url("/assets/images/banner.png");
  color: #fff;
  text-align: center;
}

footer p {
  padding: 2px 0 2px 0;
  margin-bottom: 0;
}

/*probably obsolete since the blog is not embedded, but may go back to it
#embedblog {
  width: 100%;
  border: 0;
  overflow-y: auto;
}*/

.clear {
  display: none;
  clear: both;
}

@media (min-width: 600px) { /*sidebar styles for large screens*/
  aside {
    position: absolute;
    top: 0;
    left: 0;
    right: 80%;
    min-height: 100%;
  }

  .sidebar-display-expand {
    display: none;
  }

  .sidebar-display-full {
    display: block;
  }
}

/*layout fixes for small screens*/
@media (max-width: 1024px) { /*remove margins from body*/
  body {
    margin: 0;
  }
}

@media (max-width: 640px) { /*collapse sidebar and add button to expand*/
  main:not(.nonav) {
    margin-left: 32px;
  }

  #content > aside.collapsed { /*override padding rule for all content elements*/
    padding: 10px 0px 10px 0px;
  }

  aside:not(.collapsed) {
    position: absolute;
    top: 0;
    left: 0;
    width: 10em;
    max-width: 100%;
    min-height: 100%;
  }

  aside.collapsed {
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    min-height: 100%;
  }

  aside:not(.collapsed) .sidebar-display-full {
    display: block;
  }

  aside.collapsed .sidebar-display-full {
    display: none;
  }
}

@media (min-width: 401px) {
  nav#top li:not(:first-child) {
    border-left: 1px solid #bbb;
  }

  nav#top li:not(:last-child) {
    border-right: 1px solid #bbb;
  }
}

@media (max-width: 400px) { /*rearrange top nav into vertical list*/
  nav#top li {
    display: block;
    padding: 1px 8px 1px 8px;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #bbb;
  }
}

@media (max-height: 800px) { /*shrink header to increase useful screen height*/
  header {
    padding: 1px 0px 0px 0px;
  }
}



/*page elements*/
a {
  font-weight: bold;
  color: #09f;
}

a:link, a:visited {
  text-decoration: none;
}

a:hover, a:focus {
  text-decoration: underline;
}

a img {
  border: 2px solid #09f;
}

a.button {
  display: inline-block;
  background-color: #09f;
  color: #fff;
  margin: 0.5em;
  padding: 0.5em;
  border-radius: 1.75em;
  font-size: 1.5em;
  font-weight: normal;
  text-transform: uppercase;
}

a.button:hover, a.button:focus {
  text-decoration: none;
}

.smalltext {
  font-size: 0.8em;
}

.key {
  display: inline-block;
  min-width: 1.1em;
  margin: 0px 1px 0px 1px;
  border: 1px solid #aaa;
  border-radius: 1px;
  padding: 0px 1px 0px 1px;
  background-color: #fff;
  color: #333;
  box-shadow: -0.1em -0.1em 0.1em -0.1em #aaa inset;
  text-align: center;
}

hr {
  height: 1px;
  border: none;
  background-color: #bbb;
}



/*launch page*/
body.launch {
  margin: 0;
}

.launch header {
  font-size: 1.25em;
  padding-bottom: 0;
  margin-bottom: 0px;
}

.launch nav#top ul {
  margin-bottom: 0;
}

.launch main {
  background-color: #000;
  /*background-image: url("/assets/images/banner.png");
  background-size: auto 100%;*/
  color: #fff;
  text-align: center;
  margin-top: 0;
}

.launch main h2 {
  font-weight: normal;
  text-transform: uppercase;
  border-bottom: none;
}

.launch .game canvas {
  display: block;
  margin: 0 auto;
}

.launch hr {
  width: 100%;
  max-width: 640px; /*width of current demo*/
  margin: 2em 0 2em 0 auto;
}



/*blog entries*/
article.blog  {
  width: 100%;
  border-bottom: 1px solid #bbb;
  margin-bottom: 1.5em;
}

.blog h3 {
  margin-bottom: 0;
}

.blog h5 {
  color: #999;
  font-weight: normal;
}

.blog h5 a {
  font-weight: normal;
}

.blog img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}



/*portfolio table*/
.portfolio {
  display: block;
  margin: 0 auto;
}

.portfolio article {
  display: inline-block;
  width: 256px;
  max-width: 100%;
  margin: 0.5em;
}

.portfolio img {
  max-width: 100%;
}

.portfolio .caption {
  height: 5em;
  overflow-y: hidden;
}



/*game of life table*/
#life table {
  border-spacing: 0;
  border: 1px solid #aaa;
}

#life td {
  padding: 3px;
  border: 1px solid transparent;
}

#life table:hover td:not(:hover) {
  border: 1px solid #aaa;
}

#life td:hover {
  border: 1px solid #000;
}

#life td.alive {
  background-color: #000;
}

#life input, #life label {
  margin: 2px;
}

#life label {
  font-size: 0.8em;
}

#life input[type="range"] {
  height: 0.8em;
}
