:root {
  --primary: #FF524C;
  --body-bg: #f9fafc;
  --body-color: #f9fafc;
  --content-bg: #fff;
  --content-color: #1e272e;
  --button-bg: #eee;
  --button-border: #eee;
}

body {
  margin: 0;
  padding: 2rem;
  background: var(--body-bg);
  color: var(--body-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

a {
  text-decoration: none;
  color: var(--primary);
  font-weight: bold;
  cursor: pointer;
}

h1:first-child {
  font-size: 3rem;
}

h1:not(:first-child) {
  text-align: center;
  background: var(--body-bg);
  margin-left: -2rem;
  margin-right: -2rem;
  margin-top: 2rem;
  padding: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #384956;
}

.wrapper {
  max-width: 700px;
  padding: 2rem;
  background: var(--content-bg);
  color: var(--content-color);
  margin: auto;
  overflow: hidden;
  border-radius: 0.5rem;
  box-shadow: 0 5px 10px rgb(0 0 0 / 5%);
}

.wrapper.header {
  margin-bottom: 2rem;
  padding: 1.5rem 2rem;
}

.wrapper.header > .inner {
  display: flex;
  align-items: center;
}

.wrapper.footer {
  margin-top: 2rem;
}

.wrapper.footer > .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #666;
}

.wrapper.header > .inner > .brand {
  margin-right: auto;
  font-weight: bold !important;
}

.wrapper.header > .inner > a:not(.brand) {
  margin-right: 0.5rem;
  font-weight: normal;
  background: var(--button-bg);
  padding: 0.5rem;
  border-radius: 0.25rem;
  color: var(--content-color);
}

.wrapper.header > .inner > a:not(.brand):hover,
.wrapper.header > .inner > a:not(.brand).active {
  color: white;
  background: var(--primary);
}

.wrapper.header > .inner > a:not(.brand).active {
  font-weight: bold;
}

.wrapper.page > .inner > *:first-child {
  margin-top: 0;
}

.wrapper.page > .inner > *:last-child {
  margin-bottom: 0;
}

.wrapper.page pre {
  background: #eee;
  padding: 1rem;
}

.wrapper.page img {
  max-width: 100%;
}

*:not(pre) > code {
  color: chocolate;
  font-weight: bold;
}

.page- > .wrapper.page {
  background-image: url(/assets/cover.jpg);
  background-repeat: no-repeat;
  background-size: 100% 200px;
  padding-top: calc(200px + 1rem);
}

table {
  width: 100%;
}

th {
  text-align: left;
}

th,
td {
  padding: 0.5rem;
}

.calculator table {
  border: 2px solid #eee;
  padding: 1rem;
  border-radius: 0.25rem;
}

.calculator th:last-child,
.calculator td:last-child {
  text-align: right;
}

.calculator input {
  width: 100%;
}

.calculator input[type=checkbox] {
  width: auto;
}

.calculator tr > *:first-child {
  width: 120px;
}

.calculator tr > *:nth-child(3) {
  width: 75px;
}

.calculator tr > *:last-child {
  width: 70px;
}

.calculator tfoot tr:first-child th {
  border-top: 2px solid var(--button-border);
}

.calculator tfoot th:last-child {
  color: var(--primary);
}

.calculator button {
  font: inherit;
  cursor: pointer;
  outline: inherit;
  display: block;
  width: 100%;
  border: 2px solid var(--primary);
  color: var(--primary);
  margin-top: 1rem;
  border-radius: 0.25rem;
  padding: 1rem;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
  background: none;
  transition: all 200ms ease-in-out;
}

.calculator button:hover,
.calculator button:focus {
  background: var(--primary);
  color: white;
}

@media screen and (max-width: 700px) {
  body {
    padding: 0;
  }

  .wrapper {
    border-radius: 0;
  }

  .wrapper.header {
    margin-bottom: 2px !important;
  }

  .wrapper.footer {
    margin-top: 2px !important;
  }

  .wrapper.footer > .inner {
    display: block;
  }
}

@media screen and (max-width: 800px) {
  .wrapper.header > .inner {
    display: block;
  }

  .wrapper.header > .inner > a {
    margin: 0 !important;
    display: inline-block;
  }

  .wrapper.header > .inner > .brand {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 1rem !important;
  }

  .wrapper.header > .inner > a:not(.brand) {
    width: calc(50% - 2rem);
    text-align: center;
    margin-top: 0.5rem !important;
    margin-right: 0.5rem !important;
  }
}
