@import url(https://fonts.googleapis.com/css2?family=Hind:wght@400;700&display=swap);

:root {
  --bg-color: #fff;
  --text-color: #335;
  --blur-color: #335a;
  --link-color: #45f;
  --vlink-color: #97d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1d1b27;
    --text-color: #999ca9;
    --blur-color: #999ca9aa;
    --link-color: #67f;
    --vlink-color: #86b;
  }
}

* {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1em;
  text-decoration: none;
  clear: left;
}

/* Typography */

html {
  font-size: 18px;
  background: var(--bg-color);
}

body {
  font-family: Hind, sans-serif;
  font-weight: 400;
  color: var(--text-color);
  line-height: 1.5;

  white-space: normal;
  -webkit-font-smoothing: antialiased;
}

a:link { color: var(--link-color); }
a:visited { color: var(--vlink-color); }
a:hover { text-decoration: underline; }

p, ul, ol, dl {
  hyphens: auto;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dt.label, dd, hr, pre {
  margin-bottom: 1rem;
}

h1 {
  margin-right: 1.5rem;
  white-space: nowrap;
  font-size: 2em;
}

h2 {
  font-size: 1em;
}

h1, h2 {
  font-weight: 700;
}

h1:target, h2:target, h3:target, h4:target, h5:target, h6:target {
  text-decoration: underline;
}

ul li {
  position: relative;
  margin-left: 1.2rem;
  list-style: none;
}

ul li::before {
  content: '•';
  font-size: 1.25rem;
  line-height: 1.3;
  position: absolute;
  left: -1.05rem;
}

hr {
  margin: 1rem 0;
  height: 1px;
  background-color: var(--blur-color);
  border-radius: 0.5px;
  opacity: 0.15;
}

em, em * {
  font-style: normal;
  text-decoration: underline;
}

sup, sub {
  font-size: 0.5em;
}

abbr, acronym {
  cursor: help;
}

dt+dt, dt+dd.attr {
  margin-top: -1rem;
}

dd { margin-left: 1.2rem; }
dd ul, dd ol { margin-left: -1.2rem; }
dd.attr { margin-left: 0; }

dt, dd.attr, dd p, dd ul, dd ol, dd dl, dd dd {
  margin-bottom: 0.5rem;
}

dt.label {
  font-size: 0.8em;
  line-height: 1;
}

dd.label * {
  line-height: inherit;
}

dt.label {
  color: var(--blur-color);
}

.footnote {
  font-size: 0.8em;
  color: var(--blur-color);
  margin-top: -1rem;
}

/* Layout */

html {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
}

body {
  margin: 2rem 1rem;
  max-width: 45rem;
}

/* Design */

header {
  padding-top: 1rem;
  display: flex;
  flex-flow: row-reverse;
  align-items: flex-start;
}

header .profile {
  flex: auto;
  text-align: left;
  line-height: 1.5rem;
}

header .profile h1 {
  font-size: 1.5em;
  margin-bottom: 0;
}

header .profile p {
  margin-bottom: 0;
}

header .profile a {
  text-wrap: nowrap;
}

header .emblem {
  flex: 0 0 auto;
  margin: 0.25rem 1rem;
  width: 144px;
  font-size: 0;
  position: relative;
}

header .emblem picture {
  position: absolute;
  z-index: 1;
}

header .emblem.object-ready picture {
  opacity: 0;
}

header .emblem object {
  pointer-events: none;
}

header .emblem * {
  width: 100%;
  height: auto;
  min-width: 96px;
  aspect-ratio: 9 / 4;
}

main {
  margin-bottom: 2rem;
}

footer {
  text-align: center;
  font-size: min(0.8em, 14px);
  color: var(--blur-color);
}

footer p {
  margin: 0;
}

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

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

footer::before {
  content: '';
  display: block;
  height: 2px;
  background: var(--link-color);
  border-radius: 1px;
  margin-bottom: 0.5rem;
}

.index h2 { margin-top: 2rem; margin-bottom: 0; }

.error body { max-width: 30rem; }

/* Responsive */

@media screen and (min-width: 1600px) {
  .index, .error {
    font-size: 22px;
    align-items: center;
    min-height: 95%;
  }
  header .emblem { width: 176px; }
}

@media screen and (max-width: 600px) {
  html { font-size: 17px; }
  body { margin: 1rem 0.5rem 1.5rem; }
  header .emblem { width: 128px; }
  .index h2 { margin-top: 1rem; }
}

@media screen and (max-width: 400px) {
  html { justify-content: flex-start; }
  header { display: block; }
  header .emblem {
    width: 176px;
    margin: -1rem auto 1rem;
    padding: 2rem 0;
  }

  /* Hide nonessential text in narrow views. */
  .nonessential { display: none; }
}

@media screen and (max-width: 300px) {
  html { font-size: 15px; }
  header .emblem { width: 128px; padding: 1rem 0; }
}

html { transition: font-size 250ms; }
body { transition: margin 250ms; }
.index h2 { transition: margin-top 75ms; }
header .emblem { transition: width 250ms; }
header .emblem picture { transition: opacity 50ms; }
