:root,
[data-ic-theme=dark] {
  /* globals */
  --ic-font: normal normal 400 normal 1rem / 1.5 "Segoe UI", Arial, Helvetica, sans-serif;
  --ic-url-tick: url("/images/tick-green-svg.svg");

  /* default theme (dark) */
  color-scheme: dark;
  --ic-bg: linear-gradient(#223, #336, #223);
  --ic-bg-color: #223;
  --ic-bg-error: #600;
  --ic-bg-success: #050;
  --ic-filter-logo: none;
  --ic-filter-no-color: contrast(0%) brightness(200%);
  --ic-text: #fff;
  --ic-text-swap: #000;
  --ic-link: #9cf;
  --ic-link-active: #9fc;
  --ic-link-visited: #c9f;
  --ic-btn-bg: #193;
  --ic-btn-bg-dim: #082;
  --ic-input-bg: #f3f3f3;
}

[data-ic-theme=light] {
  color-scheme: only light;
  --ic-bg: linear-gradient(#bdf, #def, #bdf);
  --ic-bg-color: #bdf;
  --ic-bg-error: #d44;
  --ic-bg-success: #4c4;
  --ic-filter-logo: invert(100%) hue-rotate(180deg);
  --ic-filter-no-color: contrast(0%) brightness(0%);
  --ic-text: #000;
  --ic-text-swap: #fff;
  --ic-link: #036;
  --ic-link-active: #063;
  --ic-link-visited: #306;
  --ic-btn-bg: #3b5;
  --ic-btn-bg-dim: #2a4;
  --ic-input-bg: #1c1c1c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:any-link {
  cursor: pointer;
  text-decoration: underline;
}

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

:visited {
  color: var(--ic-link-visited);
}

:any-link:active {
  color: var(--ic-link-active);
}

:any-link:read-write {
  cursor: text;
}

body {
  background: var(--ic-bg);
  color: var(--ic-text);
  font: var(--ic-font);
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow: visible;
}

.header,
body > header {
  background: var(--ic-bg-color);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  position: sticky;
  top: 0;
  left: 0;
  margin: 0 0 0.5em 0;
  padding: 0.5em;
  width: 100%;
}

.header-nav,
body > header > nav {
  display: flex;
  margin: 0;
  padding: 0;
}

main {
  padding: 0 0.5em;
}

main > .mainpage {
  margin: auto;
  max-width: 50em;
}

body > footer {
  padding: 0.5em;
}

hr {
  border: 0.0625em solid var(--ic-text);
  margin: 0.5em;
}

img,
video {
  max-width: 100%;
  height: auto;
}

button,
input {
  height: 3em;
  font: inherit;
}

input:is([type=text], [type=email], [type=password], [type=checkbox]) {
  background: var(--ic-input-bg);
  border: 0.0625em outset var(--ic-text-swap);
  border-radius: 0.5em;
  color: var(--ic-text-swap);
  padding: 0.5em;
}

input[type=checkbox] {
  appearance: none;
  margin: 0.75em;
  padding: 0;
  width: 1.5em;
  height: 1.5em;
}

input[type=checkbox]:checked {
  background: var(--ic-btn-bg);
  border-style: inset;
}

input[type=checkbox]:checked::before {
  display: block;
  color: var(--ic-text);
  content: var(--ic-url-tick);
  filter: var(--ic-filter-no-color);
  margin: -0.0625em;
  padding: 0.125em 0.25em;
  width: 1.5em;
  height: 1.5em;
}

label {
  font: inherit;
}

form {
  display: flex;
  flex-direction: column;
  border: 0.125em solid var(--ic-text);
  border-radius: 0.5em;
  padding: 0.5em;
  margin: 3em 0;
}

.formfield {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 1em 0;
}

.formfield > label {
  flex: 1 1 10em;
}

@media (min-width: 30rem) {
  .formfield > label {
    max-width: 10em;
  }
}

.formfield > input:is([type=text], [type=email], [type=password]) {
  flex: 1 1 auto;
  min-width: 10em;
  max-width: 30em;
}

.formfield > input[type=checkbox] ~ label {
  max-width: 30em;
  margin: 0.5em 0;
}

.logo {
  height: 3em;
  max-width: none;
}

.btn {
  background: var(--ic-btn-bg);
  color: var(--ic-text);
  cursor: pointer;
  font: inherit;
  margin: 0 0.25em;
  border-radius: 1.5em;
  border: 0.125em solid transparent;
  padding: 0.625em;
  height: 3em;
  width: auto;
  user-select: none;
  -webkit-user-select: none;
}

.btn:hover {
  border-color: var(--ic-text);
  transition-duration: 125ms;
}

.btn:active:hover {
  background: var(--ic-btn-bg-dim);
  border-color: var(--ic-text);
}

.btn:is(:disabled, :disabled:active) {
  visibility: hidden;
}

.btn-hollow {
  background: none;
  border-color: var(--ic-text);
}

.btn-hollow:hover {
  background: var(--ic-btn-bg);
}

.btn-hollow:active:hover {
  background: var(--ic-btn-bg-dim);
}

.icon {
  height: 1.5em;
  max-width: none;
}

.themed-image {
  filter: var(--ic-filter-logo);
}

/* fix light theme alt text */
.themed-image::before {
  filter: var(--ic-filter-logo);
}

.no-link {
  text-decoration: none;
}

.center {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tickgreen {
  list-style: none;
  padding: 0;
  text-align: justify;
}

.tickgreen > li {
  margin: 0.5em 0;
}

.tickgreen > li::before {
  display: inline-block;
  content: var(--ic-url-tick);
  margin: 0 0.5em;
  width: 1em;
}

.msg {
  border-radius: 0.5em;
  padding: 0.5em;
  margin: 0.5em 0;
}

.msg.error {
  background: var(--ic-bg-error);
}

.msg.success {
  background: var(--ic-bg-success);
}

.hide {
  display: none !important;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
  font-weight: 100;
  letter-spacing: 0.03125rem;
  word-spacing: 0.0625rem;
  margin: 0 0 1rem 0;
}

h1, .h1 {
  font-size: calc(1rem + 1.6vw);
}
@media (min-width: 62.5rem) {
  h1, .h1 {
    font-size: 2rem;
  }
}

h2, .h2 {
  font-size: calc(1rem + 0.8vw);
}
@media (min-width: 62.5rem) {
  h2, .h2 {
    font-size: 1.5rem;
  }
}

h3, .h3 {
  font-size: calc(1rem + 0.4vw);
}
@media (min-width: 62.5rem) {
  h3, .h3 {
    font-size: 1.25rem;
  }
}

h4, .h4 {
  font-size: calc(1rem + 0.2vw);
}
@media (min-width: 62.5rem) {
  h4, .h4 {
    font-size: 1.125rem;
  }
}

h5, .h5 {
  font-size: calc(1rem + 0.1vw);
}
@media (min-width: 62.5rem) {
  h5, .h5 {
    font-size: 1.0625rem;
  }
}

h6, .h6 {
  font-size: calc(1rem + 0.05vw);
}
@media (min-width: 62.5rem) {
  h6, .h6 {
    font-size: 1.03125rem;
  }
}

p {
  margin: 0 0 1rem 0;
}

.font-small {
  font-size: 0.75em;
}
