:root {
  --color-bg-primary: #fff;
  --color-bg-secondary: #f8f8f8;
  --color-bg-tertiary: #f0f0f0;
  --color-fg-primary: #3a3a3a;
  --color-fg-secondary: #555;
  --color-fg-tertiary: #999;
  --color-title-fg: #333;
  --color-link-fg: #55c;
  --color-border: #ccc;
  --color-border-secondary: #aaa;
  --color-border-tertiary: #eee;
  --color-shadow: #bbb;
  --color-shadow-accent: #989898;
  --color-shadow-secondary: #ccc;
  --color-shadow-tertiary: #ddd;
  --color-folder-bg: linear-gradient(45deg, #f0f0f0, #fafaffe0);

  /* Dark theme */
  @media (prefers-color-scheme: dark) {
    --color-bg-primary: #282828;
    --color-bg-secondary: #202020;
    --color-bg-tertiary: #101010;
    --color-fg-primary: #ccc;
    --color-fg-secondary: #aaa;
    --color-fg-tertiary: #666;
    --color-title-fg: #ddd;
    --color-link-fg: #abf;
    --color-border: #555;
    --color-border-secondary: #444;
    --color-border-tertiary: #333;
    --color-shadow: #222;
    --color-shadow-accent: #444;
    --color-shadow-secondary: #111;
    --color-shadow-tertiary: #000;
    --color-folder-bg: linear-gradient(45deg, #111, #333);
  }

  /* Elements */
  --header-height: 3em;
  --header-margin: 1px;
  --footer-height: 1em;
  --footer-margin: 2px;
}

html {
  height: -webkit-fill-available;
  height: -moz-available;
  background: var(--color-bg-primary);
  color: var(--color-fg-primary);
  font-size: 20px;
  /* font-family: Lora, "Palatino Linotype", "Book Antiqua", "New York", "DejaVu serif", serif; */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  height: 100vh;
  /* mobile viewport bug fix */
  min-height: -webkit-fill-available;
  min-height: -moz-available;
  background: var(--color-bg-tertiary);
}

a, a:visited {
  color: var(--color-link-fg);
  border-bottom: 1px dashed var(--color-border);
  text-decoration: none;
}

header {
  display: flex;
  align-items: center;
  height: var(--header-height);
  background: var(--color-bg-secondary);
  margin-bottom: var(--header-margin);
  padding: 0 .5em;
  font-size: .9em;
  box-shadow: 1px 3px 3px 0 var(--color-shadow);
}

header a {
  color: var(--color-fg-primary) !important;
  text-decoration: none;
  border-bottom: 0;
}

header .left a {
  display: flex;
  align-items: center;
}

header a:hover {
  opacity: .75;
}

header .title {
  color: var(--color-title-fg);
  font-family: 'Poppins', sans-serif;
  margin-left: .333em;
  display: inline-flex;
}

header .left,
header .right {
  display: inline-flex;
  align-items: center;
  width: 50%;
}

header .right {
  display: inline-flex;
  justify-content: right;
  text-align: right;
  opacity: .8;
}

header .icon {
  background-size: 40px !important;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

header .left .icon {
  width: 2.5em;
  height: 2.5em;
  margin-right: .5em;
}

main {
  height: calc(100% - var(--header-height) - var(--header-margin) - var(--footer-height) - var(--footer-margin));
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.25em;
}

h1 {
  font-size: 2em;
  line-height: 1.2em;
}

h2 {
  font-size: 1.5em;
  line-height: 1.1em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Open Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

img.u-featured {
  border-radius: 0.75em;
}

footer {
  width: 100%;
  height: calc(var(--footer-height) + var(--footer-margin));
  background: var(--color-bg-secondary);
  font-size: .65em;
  color: var(--color-fg-tertiary);
  letter-spacing: .02em;
  margin-top: var(--footer-margin);
  padding-top: .25em;
  text-align: center;
  box-shadow: 0 -5px 2.5px 0 var(--color-shadow);
  border-radius: 50% 50% 0 0;
}
