/* Global styles */

* {
  box-sizing: border-box;
}

/* Vars */

:root {
  --color-background: #fff8eb;
  --color-text: #282828;
  --color-link: #265c92;
  --color-link-visited: #7244c8;
  --color-link-hover: #5452ff;
  --color-border: black;
  --color-divider: lightgrey;
  --color-shadow: grey;
  --color-disabled: #888;
  --color-danger: #f99;
  --color-button: #e5e0ff;
  --color-button-border: grey;
  --measure-border-radius: 3px;
  --measure-input-height: 28px;
  --font-display: "Futura", "Helvetica Neue", helvetica, arial, sans-serif;
  --font-text: "Avenir Next", "Avenir", "Candara", "Verdana", sans-serif;
  --font-mono: "Courier Prime", "Courier", "Courier New", monospace;
  /* still waitin on universal support for "system-ui", sigh. */
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Dark mode */
@media screen and (prefers-color-scheme: dark) {
  :root {
    --color-background: #092a37;
    --color-text: #e4c485;
    --color-link: #f09d6a;
    --color-link-visited: #b082d7;
    --color-link-hover: #f26262;
    --color-border: #888;
    --color-button-border: #888;
    --color-divider: grey;
    --color-danger: #7e1b16;
    --color-button: #710d45;
    --color-shadow: #825c49;
  }
}

body {
  font-family: var(--font-text);
  background-color: var(--color-background);
  color: var(--color-text);
  max-width: 70ch;
  margin: 2em auto;
  padding: 0 1em;
}

header,
nav,
footer,
form,
h1,
h2,
h3,
h4,
h5,
h6,
.dogears,
.serial-name,
.countdown {
  font-family: var(--font-display);
}

footer {
  margin-top: 50px;
  padding-top: 25px;
  border-top: 1px solid var(--color-divider);
}

img {
  max-width: 100%;
}

li {
  margin-bottom: 5px;
}

code {
  font-family: var(--font-mono);
  font-size: 1em;
}

form p {
  font-family: var(--font-text);
}

aside {
  margin: 1em;
}

summary {
  cursor: pointer;
}

button {
  font-size: 16px;
  font-family: var(--font-display);
  font-weight: normal;
  color: var(--color-text);
  border-radius: var(--measure-border-radius);
  background-color: var(--color-button);
  border: 1px solid var(--color-button-border);
  cursor: pointer;
}

input,
.mock-input,
textarea {
  display: block;
  margin-bottom: 10px;
  margin-top: 5px;
  padding: 5px;
  width: 100%;
  border: 1px solid var(--color-button-border);
  border-radius: var(--measure-border-radius);
  font-size: 16px;
}

input,
button {
  height: var(--measure-input-height);
}

textarea {
  font-family: var(--font-ui);
  height: auto;
  -webkit-overflow-scrolling: touch;
}

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

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

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

form {
  margin-bottom: 25px;
  padding: 15px;
  display: inline-block;
  width: 100%;
  border-radius: 7px;
  border: 1px solid;
}

header {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
}

nav {
  text-align: center;
  margin-bottom: 1em;
}

h1 {
  margin-top: 0;
  margin-bottom: 0;
}

.cartouche {
  border: 1px var(--color-border) solid;
  padding: 0.1em 0.3em;
  border-radius: var(--measure-border-radius);
}

/* Be good on smalls */
@media screen and (max-width: 400px) {
  body {
    margin: 1em 0;
  }
}

@keyframes rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(359deg);
  }
}

