body {
  --body-bg: #222;
  --body-fg: #BBB;
  --limit: #FFF;
  --stars-border: #444;
  --stars-bg: #000017 url(/media/bg-dark.jpg) top left/1000px 500px fixed;
  --link: #CCC;
  --link-hover: #FFF;
  --line: #444;
  --button-hover-up: #333;
  --button-hover-dn: #222;
  --button-press-up: #000;
  --button-press-dn: #222;
  --button-x: 0;
  --pre-bg: #111;
  --pre-fg: #BBB;
  --pre-comment: #777;
  --pre-keyword: #7F9FBF;
  --pre-literal: #BFBF7F;
}

@media (prefers-color-scheme: light) {
  body {
    --body-bg: #FFF;
    --body-fg: #444;
    --limit: #000;
    --stars-border: transparent;
    --stars-bg: #00114A url(/media/bg-light.png) top left/1000px 500px fixed;
    --link: #444;
    --link-hover: #000;
    --line: #BBB;
    --button-hover-up: #FFF;
    --button-hover-dn: #EEE;
    --button-press-up: #DDD;
    --button-press-dn: #EEE;
    --button-x: -18px;
    --pre-bg: #F7F7F7;
    --pre-fg: #333;
    --pre-comment: #666;
    --pre-keyword: #07F;
    --pre-literal: #990;
  }
}

body {
  margin: 0 0 200px 0;
  font: 15px/1.5em Arial, sans-serif;
  background-color: var(--body-bg);
  color: var(--body-fg);
}

section {
  box-sizing: border-box;
  max-width: 1000px;
  padding: 0 30px;
  margin: auto;
}

nav section {
  display: flex;
}

nav ul {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  padding: 0;
  margin: 0;
  list-style: none;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 20px;
  font-size: calc(clamp(16px, 10px + 1vw, 20px));
  line-height: 100px;
  line-height: calc(clamp(60px, 10vw, 100px));
}

nav a {
  text-decoration: none;
}

nav li {
  margin-left: 10px;
}

nav li:before {
  content: '\2022';
  color: var(--body-fg);
  margin-right: 10px;
  font-size: 1.2em;
  opacity: 0.5;
}

nav li:first-child:before {
  content: '';
}

header {
  background: var(--stars-bg);
  border-top: 1px solid var(--stars-border);
  border-bottom: 1px solid var(--stars-border);
  margin-bottom: 50px;
  padding: 70px 0;
  padding: calc(clamp(56px, 7vw, 70px)) 0;
}

a {
  color: var(--link);
}

a:hover {
  color: var(--link-hover);
}

p {
  margin: 20px 0;
}

b {
  color: var(--limit);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-weight: bold;
  font-style: italic;
}

h1 {
  color: #FFF;
  font-size: 50px;
  font-size: calc(clamp(30px, 5vw, 50px));
  line-height: 1.2em;
}

h2 {
  color: var(--limit);
  line-height: 1.2em;
  padding-top: 50px;
  padding-top: calc(clamp(30px, 5vw, 50px));
  font-size: 30px;
  font-size: calc(10px + clamp(12px, 2vw, 20px));
}

h2:first-child {
  padding-top: 0;
}

nav h2 {
  line-height: 100px;
  line-height: calc(clamp(60px, 10vw, 100px));
}

h3 {
  color: var(--limit);
  font-size: 1.5em;
  line-height: 1.5em;
  margin: 0;
  margin-top: 80px;
  margin-top: calc(clamp(48px, 8vw, 80px));
}

.home-card h3 {
  margin: 0;
}

.home-card {
  position: relative;
  padding-left: 110px;
  padding-left: calc(50px + clamp(60px, 10vw, 100px));
  min-height: 80px;
  min-height: calc(50px + clamp(30px, 5vw, 50px));
  margin: 50px 0;
  margin: calc(clamp(30px, 5vw, 50px)) 0;
}

.home-icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 80px;
  height: 80px;
  width: calc(50px + clamp(30px, 5vw, 50px));
  height: calc(50px + clamp(30px, 5vw, 50px));
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border-radius: 10px;
}

.home-time {
  font-weight: normal;
}

.showbox {
  padding: 10px;
  height: 350px;
  background: var(--line);
  border-radius: 20px;
}

.showbox>div {
  height: 350px;
  border-radius: 14px;
}

#instructions {
  margin: 0 0 30px 30px;
  padding: 0 30px;
  float: right;
  width: 27%;
  border: 1px solid var(--line);
  border-radius: 20px;
}

#instructions h3 {
  padding: 0;
  margin: 30px 0 15px 0;
  line-height: 20px;
  font-size: 20px;
}

#instructions ul {
  margin: 15px 0 30px 0;
  padding: 0 0 0 15px;
}

.project {
  margin: 80px 0;
  padding: 0 0 0 360px;
  clear: both;
}

.project h3 {
  padding: 0;
  margin: 0 0 30px 0;
  font-size: 30px;
  line-height: 1.3em;
}

.project .image {
  padding: 0 0 80px 0;
  margin-left: -360px;
  float: left;
}

.project .image>div {
  padding: 10px;
  background: var(--line);
  border-radius: 20px;
}

.project .image>div>div {
  width: 300px;
  height: 300px;
  border-radius: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #fff;
}

#shader {
  text-align: center;
  margin: 0 auto 40px auto;
}

#shader canvas {
  max-width: 100%;
  cursor: move;
}

.buttons {
  text-align: center;
}

.download,
.view {
  margin: 0 auto;
  line-height: 40px;
  padding: 0 13px 0 15px;
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 20px;
  text-decoration: none;
}

.download:hover,
.view:hover {
  border: 1px solid var(--line);
  background: var(--button-hover-up);
  background: linear-gradient(var(--button-hover-up), var(--button-hover-dn));

}

.download:active,
.view:active {
  border: 1px solid var(--line);
  background: var(--button-press-up);
  background: linear-gradient(var(--button-press-up), var(--button-press-dn));
}

.download span,
.view span {
  width: 18px;
  height: 40px;
  margin-left: 10px;
  display: inline-block;
  vertical-align: bottom;
  background: url(buttons.svg) no-repeat 0 0;
}

/* hack to fix vertical alignment in IE 6 */
* html #download span,
* html #view span {
  vertical-align: middle;
}

.download:hover span {
  background-position: var(--button-x) -40px;
}

.view span {
  background-position: var(--button-x) -80px;
}

.view:hover span {
  background-position: var(--button-x) -120px;
}

.indented {
  margin-left: 30px;
}

.indented label {
  display: block;
}

input[type=radio] {
  -webkit-appearance: initial;
  background: #777;
  width: 15px;
  height: 15px;
  border-radius: 10px;
  vertical-align: text-bottom;
  margin-right: 5px;
}

input[type=radio]:checked {
  background: var(--body-bg);
  border: 4px solid #777;
}

input[type=radio]:focus {
  background: #FFF;
  outline: none;
}

input[type=radio]:focus:checked {
  background: var(--body-bg);
  border: 4px solid var(--limit);
}

input[type=checkbox] {
  -webkit-appearance: initial;
  box-shadow: inset 0 0 0 2px #777;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  vertical-align: bottom;
  margin-right: 5px;
}

input[type=checkbox]:focus {
  box-shadow: inset 0 0 0 2px var(--limit);
  outline: none;
}

input[type=checkbox]:checked {
  box-shadow: inset 0 0 0 15px #777;
}

input[type=checkbox]:checked:focus {
  box-shadow: inset 0 0 0 15px var(--limit);
}

input[type=checkbox]:checked:after {
  position: relative;
  top: 3px;
  left: 2px;
  content: '';
  width: 8px;
  height: 4px;
  display: block;
  border-left: 3px solid var(--body-bg);
  border-bottom: 3px solid var(--body-bg);
  -webkit-transform: rotate(-55deg);
  -ms-transform: rotate(-55deg);
  transform: rotate(-55deg);
}

pre {
  color: var(--pre-fg);
  margin: 30px;
  padding: 8px 10px;
  white-space: pre-wrap;
  background: var(--pre-bg);
  border-radius: 5px;
}

pre,
code {
  font: 12px Monaco, Consolas, Monospace;
}

code {
  background: rgba(191, 191, 191, 0.2);
  margin: -2px 0;
  padding: 2px 4px;
  border-radius: 4px;
}

pre .comment,
pre .comment .keyword,
pre .comment .literal {
  color: var(--pre-comment);
}

pre .keyword {
  color: var(--pre-keyword);
}

pre .literal {
  color: var(--pre-literal);
}

@media (max-width: 650px) {
  .project {
    padding: 0;
    margin: 0 0 100px 0;
  }

  .project h3 {
    font-size: 25px;
    line-height: 30px;
    margin-bottom: 30px;
  }

  .project .image {
    float: none;
    margin: auto;
    width: 100%;
    max-width: 320px;
    padding-bottom: 30px;
  }

  .project .image>div>div {
    padding-top: 100%;
    width: 100%;
    height: 0;
  }

  pre {
    margin: 30px 0;
    font-size: 10px;
  }
}
