
/* Base Styles
–––––––––––––––––––––––––––––––––––––––––––––––––– */
:root {
  --spacing: 1rem;
  --border-radius: 4px;
  --color-scale-1: #fff;
  --color-scale-2: #eee;
  --color-scale-3: #555;
  --color-scale-4: #222;
  --color-negative: #e66;
  --color-positive: #6e6;
  --color-warning: #ea4;
  --color-info: #8ef;
  --color-primary: #66e;
  --color-link: #1eaedb;

  /* theme colors */
  --foreground: var(--color-scale-4);
  --foreground-muted: var(--color-scale-3);
  --background-rised: var(--color-scale-2);
  --background: var(--color-scale-1);
  --color-invalid: var(--color-negative);
  --color-valid: var(--color-positive);
  --body-font-family: "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", "sans-serif";
  --title-font-family: var(--body-font-family);
}

@media (prefers-color-scheme: dark) {
  :root {
    --foreground: var(--color-scale-1);
    --foreground-muted: var(--color-scale-2);
    --background-rised: var(--color-scale-3);
    --background: var(--color-scale-4);
  }
}

html {
  /* html is set to 10px, so 1rem = 10px */
  font-size: 10px;
}

body {
  margin: 0;
  font-size: 1.5em;
  line-height: 1.6;
  font-weight: 400;
  font-family: var(--body-font-family);
  color: var(--foreground);
  background-color: var(--background);
}

* {
  box-sizing: border-box;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--spacing);
}

.full-width {
  width: 100%;
}

.fluid {
  max-width: 100%;
}

/* Typography
–––––––––––––––––––––––––––––––––––––––––––––––––– */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0.75em;
  margin-bottom: 0.25em;
  font-weight: 300;
  font-family: var(--title-font-family);
}

h1 {
  font-size: 4em;
  line-height: 1.2;
  letter-spacing: -0.05em;
}

h2 {
  font-size: 3em;
  line-height: 1.25;
  letter-spacing: -0.05em;
}

h3 {
  font-size: 2.4em;
  line-height: 1.3;
  letter-spacing: -0.05em;
}

h4 {
  font-size: 1.8em;
  line-height: 1.35;
  letter-spacing: -0.04em;
}

h5 {
  font-size: 1.4em;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

h6 {
  font-size: 1.2em;
  line-height: 1.6;
  letter-spacing: 0;
}

@media (min-width: 800px) {
  h1 { font-size: 5em; }
  h2 { font-size: 3.75em; }
  h3 { font-size: 3em; }
  h4 { font-size: 2em; }
  h5 { font-size: 1.4em; }
  h6 { font-size: 1.2em; }
}

/* Links
–––––––––––––––––––––––––––––––––––––––––––––––––– */
a {
  color: var(--color-link);
}

a:not(.button):hover,
a:not(.button):focus {
  filter: brightness(90%);
  text-decoration: none;
}

/* Buttons
–––––––––––––––––––––––––––––––––––––––––––––––––– */
button,
.button,
[type="submit"],
[type="button"] {
  display: inline-block;
  height: 38px;
  margin: 0;
  padding: 0 var(--spacing);
  color: var(--foreground-muted);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 38px;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--border-radius);
  border: 1px solid var(--foreground-muted);
  background-color: var(--background);
  cursor: pointer;
}

button:disabled,
.button:disabled,
[type="submit"]:disabled,
[type="button"]:disabled {
  pointer-events: auto;
  cursor: not-allowed;
  opacity: 0.5;
}

.primary {
  color: var(--background);
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

button:hover:not(:disabled),
button:focus:not(:disabled),
button.active:not(:disabled),
.button:hover:not(:disabled),
.button:focus:not(:disabled),
.button.active:not(:disabled),
[type="submit"]:hover:not(:disabled),
[type="submit"]:focus:not(:disabled),
[type="submit"].active:not(:disabled),
[type="button"]:hover:not(:disabled),
[type="button"]:focus:not(:disabled),
[type="button"].active:not(:disabled) {
  filter: brightness(90%);
}

button.primary:focus,
button.primary:hover,
.button.primary:focus,
.button.primary:hover,
[type="submit"].primary:focus,
[type="submit"].primary:hover,
[type="button"].primary:focus,
[type="button"].primary:hover {
  filter: brightness(110%);
}

/* Forms
–––––––––––––––––––––––––––––––––––––––––––––––––– */
form > * {
  margin-top: var(--spacing);
  margin-bottom: var(--spacing);
}

input:not([type]),
input[type="email"],
input[type="number"],
input[type="search"],
input[type="text"],
input[type="tel"],
input[type="url"],
input[type="password"],
textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input:not([type]),
input[type="email"],
input[type="number"],
input[type="search"],
input[type="text"],
input[type="tel"],
input[type="url"],
input[type="password"],
textarea,
select {
  height: 38px;
  padding: 6px 10px; /* The 6px vertically centers text on FF, ignored by Webkit */
  background-color: var(--background);
  border: 1px solid var(--foreground-muted);
  border-radius: var(--border-radius);
  color: var(--foreground-muted);
  box-shadow: none;
  font-size: 1.5rem;
  width: 100%;
  min-width: 0;
}

textarea {
  min-height: 65px;
  padding-top: 6px;
  padding-bottom: 6px;
}

input:not([type]):focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border: 1px solid var(--color-info);
  outline: 0;
}

input:not([type]):invalid:not(:placeholder-shown),
input[type="email"]:invalid:not(:placeholder-shown),
input[type="number"]:invalid:not(:placeholder-shown),
input[type="search"]:invalid:not(:placeholder-shown),
input[type="text"]:invalid:not(:placeholder-shown),
input[type="tel"]:invalid:not(:placeholder-shown),
input[type="url"]:invalid:not(:placeholder-shown),
input[type="password"]:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown) {
  border: 1px solid var(--color-invalid);
  outline: 0;
}

/*
.row > input:not([type="radio"]):not([type="checkbox"]):not([type="range"]),
.row > textarea,
.row > select {
  width: auto;
}
*/

label {
  position: relative;
}

label > input[type="file"] {
  position: absolute;
  visibility: hidden;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

label,
legend {
  display: block;
  font-weight: 600;
}

fieldset {
  padding: 0;
  border-width: 0;
}

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

/* Lists
–––––––––––––––––––––––––––––––––––––––––––––––––– */
ul {
  list-style: circle inside;
}

ol {
  list-style: decimal inside;
}

ul.no-list,
ol.no-list {
  list-style: none;
}

ol,
ul {
  padding-left: 0;
  margin-top: 0;
}

ul ul,
ul ol,
ol ol,
ol ul {
  margin: 1.5rem 0 1.5rem 3rem;
  font-size: 90%;
}

.no-list-style {
  list-style: none;
  margin: 0;
}

/* Code
–––––––––––––––––––––––––––––––––––––––––––––––––– */
code {
  padding: 0.2rem 0.5rem;
  margin: 0 0.2rem;
  font-size: 90%;
  white-space: nowrap;
  background: var(--background-rised);
  border: 1px solid var(--background-rised);
  border-radius: var(--border-radius);
}

pre > code {
  display: block;
  padding: 1rem 1.5rem;
  white-space: pre-wrap;
}

/* Tables
–––––––––––––––––––––––––––––––––––––––––––––––––– */
table {
  border-collapse: collapse;
}

th,
td {
  padding: calc(var(--spacing) * 0.6) calc(var(--spacing) * 0.75);
  text-align: left;
  border-bottom: 1px solid var(--background-rised);
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

/* Colors
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.bg-rised {
  background-color: var(--background-rised);
}

/* Card
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.card {
  padding: var(--spacing);
  color: var(--foreground);
  border: 1px solid var(--foreground);
  border-radius: var(--border-radius);
  background-color: var(--background);
}

.card > .content {
  display: flex;
  flex-direction: column;
  margin-left: calc(-1 * var(--spacing));
  margin-right: calc(-1 * var(--spacing));
  padding-left: var(--spacing);
  padding-right: var(--spacing);
}

a.card {
  text-decoration: none;
}

/* Spacing
–––––––––––––––––––––––––––––––––––––––––––––––––– */
p,
.spacing {
  margin-top: var(--spacing) !important;
  margin-bottom: var(--spacing) !important;
}

.spacing-x2 {
  margin-top: calc(var(--spacing) * 2) !important;
  margin-bottom: calc(var(--spacing) * 2) !important;
}

.spacing-x4 {
  margin-top: calc(var(--spacing) * 4) !important;
  margin-bottom: calc(var(--spacing) * 4) !important;
}

.spacing-x8 {
  margin-top: calc(var(--spacing) * 8) !important;
  margin-bottom: calc(var(--spacing) * 8) !important;
}

.spacing-0 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.margin {
  margin-left: var(--spacing) !important;
  margin-right: var(--spacing) !important;
}

.margin-x2 {
  margin-left: calc(var(--spacing) * 2) !important;
  margin-right: calc(var(--spacing) * 2) !important;
}

.margin-x4 {
  margin-left: calc(var(--spacing) * 4) !important;
  margin-right: calc(var(--spacing) * 4) !important;
}

.margin-x8 {
  margin-left: calc(var(--spacing) * 8) !important;
  margin-right: calc(var(--spacing) * 8) !important;
}

.margin-0 {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.padding {
  padding: var(--spacing) !important;
}

.padding-x2 {
  padding: calc(var(--spacing) * 2) !important;
}

.padding-0 {
  padding: 0 !important;
}

.padding-horizontal {
  padding-left: var(--spacing) !important;
  padding-right: var(--spacing) !important;
}

.padding-x2-horizontal {
  padding-left: calc(var(--spacing) * 2) !important;
  padding-right: calc(var(--spacing) * 2) !important;
}

.padding-vertical {
  padding-top: var(--spacing) !important;
  padding-bottom: var(--spacing) !important;
}

.padding-x2-vertical {
  padding-top: calc(var(--spacing) * 2) !important;
  padding-bottom: calc(var(--spacing) * 2) !important;
}

/* Grid
–––––––––––––––––––––––––––––––––––––––––––––––––– */
.flex {
  display: flex;
}

.row {
  display: flex;
  flex-flow: row wrap;
}

.row:not(.glued) {
  margin-left: calc(-1 * var(--spacing));
  margin-right: calc(-1 * var(--spacing));
}

.row > * {
  width: 100%;
  margin-left: var(--spacing);
  margin-right: var(--spacing);
  margin-top: var(--spacing);
  margin-bottom: var(--spacing);
}

.row.top { align-items: flex-start; }
.row.bottom { align-items: flex-end; }
.row.stretch { align-items: stretch; }
.row.middle { align-items: center; }
.row.left { justify-content: flex-start; }
.row.right { justify-content: flex-end; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }

.column {
  display: flex;
  flex-flow: column;
}

.column > * {
  margin-top: var(--spacing);
  margin-bottom: var(--spacing);
}

.column.center { align-items: center; }
.column.left { align-items: flex-start; }
.column.right { align-items: flex-end; }
.column.stretch { align-items: stretch; }
.column.top { justify-content: flex-start; }
.column.bottom { justify-content: flex-end; }
.column.middle { justify-content: center; }
.column.between { justify-content: space-between; }

.stripped > *:nth-child(2n) {
  background-color: var(--background);
}

.stripped > *:nth-child(2n+1) {
  background-color: var(--background-rised);
}

.row.dividers > *,
.column.dividers > * {
  position: relative;
}

.row.dividers > *:not(:first-child)::before,
.column.dividers > *:not(:first-child)::before {
  content: ' ';
  display: flex;
  border-top: 1px solid var(--foreground);
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--spacing) * -1);
  bottom: calc(100% + var(--spacing));
}

.row.glued.dividers > *:not(:first-child)::before,
.column.glued.dividers > *:not(:first-child)::before {
  top: 0;
  bottom: calc(100% - 1px);
}

.column.glued > * {
  margin-top: 0;
  margin-bottom: 0;
}

.column.glued > *:not(:last-child) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.column.glued > *:not(:first-child) {
  margin-top: -1px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* soon customizable beark-point https://drafts.csswg.org/css-env-1/ */

@media (min-width: 600px) {
  .row.dividers > *:not(:first-child)::before {
    border-left: 1px solid var(--foreground);
    border-top: none;
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--spacing) * -1);
    right: calc(var(--spacing) + 100% - 1px);
  }

  .row.glued.dividers > *:not(:first-child)::before {
    top: 0;
    bottom: 0;
    left: 0;
    right: calc(100% - 1px);
  }

  .row {
    margin-top: var(--spacing);
    margin-bottom: var(--spacing);
  }

  .row > * {
    width: auto;
    margin-top: 0;
    margin-bottom: 0;
  }

  .row.no-wrap {
    flex-flow: row;
  }

  .grow {
    flex-grow: 1;
    flex-basis: 0;
  }

  .row.glued > * {
    margin-right: 0;
    margin-left: 0;
  }

  .row.glued > *:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .row.glued > *:not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  .cell-1 { width: calc(1 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-2 { width: calc(2 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-3 { width: calc(3 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-4 { width: calc(4 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-5 { width: calc(5 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-6 { width: calc(6 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-7 { width: calc(7 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-8 { width: calc(8 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-9 { width: calc(9 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-10 { width: calc(10 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-11 { width: calc(11 * 100% / 12 - var(--spacing) * 2) !important; }
  .cell-12 { width: calc(12 * 100% / 12 - var(--spacing) * 2) !important; }

  /* Offsets */
  .offset-1 { margin-left: calc(1 * 100% / 12 + var(--spacing)); }
  .offset-2 { margin-left: calc(2 * 100% / 12 + var(--spacing)); }
  .offset-3 { margin-left: calc(3 * 100% / 12 + var(--spacing)); }
  .offset-4 { margin-left: calc(4 * 100% / 12 + var(--spacing)); }
  .offset-5 { margin-left: calc(5 * 100% / 12 + var(--spacing)); }
  .offset-6 { margin-left: calc(6 * 100% / 12 + var(--spacing)); }
  .offset-7 { margin-left: calc(7 * 100% / 12 + var(--spacing)); }
  .offset-8 { margin-left: calc(8 * 100% / 12 + var(--spacing)); }
  .offset-9 { margin-left: calc(9 * 100% / 12 + var(--spacing)); }
  .offset-10 { margin-left: calc(10 * 100% / 12 + var(--spacing)); }
  .offset-11 { margin-left: calc(11 * 100% / 12 + var(--spacing)); }
}

/* Utilities
–––––––––––––––––––––––––––––––––––––––––––––––––– */

.float-right {
  float: right;
}

.float-left {
  float: left;
}

.float-clear {
  clear: both;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.no-overflow {
  overflow: hidden;
}

.scroll {
  overflow: auto;
}

.scroll-x {
  overflow-x: auto;
}

.scroll-y {
  overflow-y: auto;
}

/* Misc
–––––––––––––––––––––––––––––––––––––––––––––––––– */

hr,
.divider {
  border-width: 0;
  border-top: 1px solid var(--foreground-muted);
  margin: 0;
}

hr {
  margin-top: var(--spacing);
  margin-bottom: var(--spacing);
}

@media (min-width: 600px) {
  .row > hr,
  .row > .divider {
    border-width: 0;
    border-left: 1px solid var(--foreground-muted);
    margin-left: -1px;
  }
}

/*
@media (min-width: 600px) {}
@media (min-width: 800px) {}
@media (min-width: 1000px) {}
@media (min-width: 1200px) {}
*/
