:root {
  --header-height: 400px;
  --header-overlap: 150px;
  --min-main-overhang: 100px;
  --header-bar-height: 48px;
  --main-width: 600px;
  --system-width: 1000px;
  --footer-spacing: 8px;
  --page-background: #262626;
  --main-background: #423c3c;
  --text-bright:rgba(255,255,255,   1);
  --text-medium:rgba(255,255,255, .75);
  --text-dimmed:rgba(255,255,255, .55);
  --text-padding: 16px;
  --card-shadow: 0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);
}

@media (max-width: 500px) {
  :root {
    --header-height: 300px;
    --header-overlap: 120px;
  }
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--page-background);
  min-width: 200px;
}


header {
  height: calc(var(--header-height) - var(--header-overlap));
  overflow-y: visible;
  position: relative;
  display: flex;
  flex-direction: row;
  padding: var(--text-padding);
  padding-bottom: 0;
  box-sizing: border-box;
  align-items: flex-start;
  justify-items: flex-start;
}

@media(max-width: 380px) {
  header {
    flex-direction: column;
    align-items: center;
  }

  .siteTitle {
    text-align: center;
  }

  nav {
    flex: 1;
    width: 100%;
    text-align: center;
  }
}

header:not(.homepage) {
  justify-content: space-between;
}

header.homepage {
  flex-direction: column;
  align-items: center;
  height: calc(var(--header-height) - var(--header-overlap) + var(--header-bar-height));
}

header.homepage::before {
  content: ' ';
  flex: 1;
}

header .siteTitle {
  margin: 0;
}

header.homepage .siteTitle {
  font-size: 4em;
}

@media (max-width: 500px) {
  header.homepage .siteTitle {
    font-size: 15vw;
  }
}

header:not(.homepage) .siteTitle {
  font-size: 1.2em;
}

header nav {
  display: block;
  border: solid 5px transparent;
}

header nav a {
  margin: 0 calc(1.5 * var(--text-padding));
}

@media (max-width: 500px) {
  header nav a {
    margin: 0 8px;
  }
}

header.homepage nav {
  border: none;
  background: var(--main-background);
  height: var(--header-bar-height);
  width: var(--main-width);
  max-width: calc(100vw - var(--text-padding));
  display: flex;
  flex-direction: row;
  justify-content: center;
  border-bottom: solid 1px var(--text-dimmed);
}

header.homepage nav a {
  height: 100%;
  padding: 14px;
  box-sizing: border-box;
}


header .headerBackground {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: -1;
  user-select: none;
}

header .headerBackground img {
  z-index: -1;
  object-fit: cover;
  object-position: center 75%;
}

header .headerBackground::after {
  content: ' ';
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.35);
}

header:not(.homepage) ~ h1.pageTitle {
  width: var(--main-width);
  margin: 0 auto;
  padding: var(--text-padding);
  box-sizing: border-box;
  height: 80px;
  margin-top: -80px;
}

main.mainColumn {
  min-height: calc(var(--header-overlap) + var(--min-main-overhang));
}

.mainColumn {
  width: var(--main-width);
  max-width: calc(100vw - var(--text-padding));
  box-sizing: border-box;
  padding: var(--text-padding);
  margin: 0 auto;
  background: var(--main-background);
  box-shadow: var(--card-shadow);
}

header.homepage ~ .mainColumn {
  min-height: calc(var(--header-overlap) + var(--min-main-overhang) - var(--header-bar-height));
}

.mainColumn ~ .mainColumn {
  margin-top: calc(2 * var(--text-padding));
}

main.mainColumn > p:first-child {
  margin-top: 0;
}

footer {
  flex: 1;
  align-items: flex-end;
  box-sizing: border-box;
  width: var(--main-width);
  margin: 0 auto;
  padding: var(--text-padding);
  display: flex;
  flex-direction: row;
  margin-top: var(--footer-spacing);
  max-width: 100vw;
}

footer span:first-child {
  flex: 1;
}

footer > *:not(:first-child) {
  margin-left: calc(2 * var(--text-padding));
}

footer span a {
  margin: 8px;
}

@media (max-width: 600px) {
  footer {
    box-sizing: initial;
    flex-direction: column;
    height: 60px;
    align-items:center;
    justify-content:center;
    margin: 8px 0;
    padding: 0;
    height: auto;
    flex: initial;
  }

  footer > * {
    display: block;
    text-align: center;
  }


  footer span:first-child{
    flex: 0;
  }
}
