* {
  box-sizing: border-box;
}

html {
  font-size: var(--font-size);
}

body {
  font-family: var(--font-family);
  line-height: 1.8;
  color: var(--text-main);
  background: var(--background-body);

  text-size-adjust: 120%;
  -webkit-text-size-adjust: 120%;
  -moz-text-size-adjust: 120%;
  -ms-text-size-adjust: 120%;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/**
    * Typography
    */
h1 {
  font-size: 2.2em;
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-bottom: 12px;
  margin-top: 24px;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong {
  color: var(--text-bright);
}

h1,
h2,
h3,
h4,
h5,
h6,
b,
strong,
th {
  font-weight: 600;
}

q::before {
  content: none;
}

q::after {
  content: none;
}

blockquote,
q {
  border-left: 4px solid var(--focus);
  margin: 1.5em 0;
  padding: 0.5em 1em;
  font-style: italic;
}

blockquote > footer {
  font-style: normal;
  border: 0;
}

blockquote cite {
  font-style: normal;
}

/**
    * Forms
    */

button,
select,
input[type="submit"],
input[type="reset"],
input[type="button"],
input[type="checkbox"],
input[type="range"],
input[type="radio"] {
  cursor: pointer;
}

input,
select {
  display: block;
}

[type="checkbox"],
[type="radio"] {
  display: initial;
}

input,
button,
textarea,
select {
  color: var(--text-main);
  background-color: var(--background);
  font-family: inherit;
  font-size: inherit;
  margin-right: 6px;
  margin-bottom: 6px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  outline: none;
}

button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
  background-color: var(--button-base);
  padding-right: 30px;
  padding-left: 30px;
}

input[type="color"] {
  min-height: 2rem;
  padding: 8px;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  height: 1.2em;
  width: 1.2em;
  margin-left: 0;
}

input[type="radio"] {
  border-radius: 100%;
}

input {
  vertical-align: top;
}

label {
  vertical-align: middle;
  margin-bottom: 4px;
  display: inline-block;
  color: var(--text-bright);
}

input:not([type="checkbox"]):not([type="radio"]),
input[type="range"],
select,
button,
textarea {
  margin-right: 0;
  box-sizing: border-box;
  resize: vertical;
}

textarea:not([cols]) {
  width: 100%;
}

textarea:not([rows]) {
  min-height: 40px;
  height: 125px;
}

select {
  background: var(--background) var(--select-arrow) calc(100% - 12px) 50% / 12px
    no-repeat;
  padding-right: 35px;
}

select::-ms-expand {
  display: none;
}

select[multiple] {
  padding-right: 10px;
  background-image: none;
  overflow-y: auto;
}

option {
  background-color: var(--background);
  color: var(--text-bright);
}

input[type="checkbox"]:active,
input[type="radio"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
input[type="button"]:active,
input[type="range"]:active,
button:active {
  transform: translateY(2px);
}

input:disabled,
select:disabled,
button:disabled,
textarea:disabled {
  cursor: not-allowed;
}

::placeholder {
  color: var(--form-placeholder);
}

fieldset {
  border: 1px var(--focus) solid;
  border-radius: 6px;
  margin: 0;
  margin-bottom: 12px;
  padding: 10px;
}

legend {
  font-size: 0.9em;
  font-weight: 600;
}

button:focus, input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 2px var(--focus);
}

a {
  text-decoration: none;
  color: var(--links);
}

a:hover {
  text-decoration: underline;
}

/**
    * Code
    */
code,
samp,
time {
  background: var(--background);
  color: var(--code);
  padding: 2.5px 5px;
  border-radius: 6px;
  font-size: 1em;
}

pre > code {
  padding: 10px;
  display: block;
  overflow-x: auto;
}

var {
  color: var(--variable);
  font-style: normal;
  font-family: monospace;
}

kbd {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-main);
  padding: 2px 4px 2px 4px;
}

/**
    * Tables, Video
    */
img,
video {
  max-width: 100%;
  height: auto;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
}

table {
  border-collapse: collapse;
  margin-bottom: 10px;
  width: 100%;
  table-layout: fixed;
}

table caption {
  text-align: left;
}

td,
th {
  padding: 6px;
  text-align: left;
  vertical-align: top;
  word-wrap: break-word;
}

thead {
  border-bottom: 1px solid var(--border);
}

tfoot {
  border-top: 1px solid var(--border);
}

tbody tr:nth-child(even) {
  background-color: var(--background);
}

tbody tr:nth-child(even) button {
  background-color: var(--background-alt);
}

tbody tr:nth-child(even) button:hover {
  background-color: var(--background-body);
}

footer {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  color: var(--text-muted);
}

body > footer {
  margin-top: 40px;
}
