@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url(/fonts/karla-latin.woff2) format('woff2');
}

/* Local fonts adjusted to Karla's widths and line metrics, so the text
   doesn't rewrap and shift the layout when Karla finishes loading. */
@font-face {
  font-family: 'Karla fallback';
  font-weight: 400;
  src: local('Arial'), local('ArialMT'), local('Liberation Sans'), local('Helvetica');
  size-adjust: 102.24%;
  ascent-override: 89.69%;
  descent-override: 24.65%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Karla fallback';
  font-weight: 700;
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold'), local('Helvetica Bold');
  size-adjust: 99.78%;
  ascent-override: 91.90%;
  descent-override: 25.26%;
  line-gap-override: 0%;
}

* {
  box-sizing: border-box;
}

:root {
  --main-color: #dedede;
  --bg-color: #211f1e;
}

/* Some mobile browsers show the page past the bottom of the body, behind
   their toolbars. Painting the page in the frame color makes that area
   read as part of the frame. It also keeps the body's photo on the body
   rather than spreading to the whole page. */
html {
  background: var(--bg-color);
}

body {
  -webkit-font-smoothing: antialiased;
  background: var(--bg-color) center / cover no-repeat;
  background-image: url(/background.jpg);
  background-image: image-set(
    url(/background.avif) type('image/avif'),
    url(/background.webp) type('image/webp'),
    url(/background.jpg) type('image/jpeg')
  );
  /* The frame, plus a band at the top that grows to cover the status bar
     on phones where the page runs edge to edge. */
  box-shadow:
    inset 0 0 0 16px var(--bg-color),
    inset 0 calc(16px + env(safe-area-inset-top, 0px)) 0 0 var(--bg-color);
  height: 100vh;
  margin: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-rendering: optimizeLegibility;
  text-shadow: 0 1px 4px var(--bg-color);
  width: 100vw;
}

.logo {
  display: block;
  height: 200px;
  position: absolute;
  right: calc(16px + env(safe-area-inset-right, 0px));
  top: calc(16px + env(safe-area-inset-top, 0px));
  width: 200px;
  z-index: 2;
}

.logo svg {
  display: block;
  height: 100%;
  width: 100%;
}

.spinner {
  display: inline-block;
  fill: #444;
  height: 40px;
  stroke: #69717d;
  width: 40px;
}

.content {
  bottom: 0;
  color: var(--main-color);
  font-family: 'Karla', 'Karla fallback', sans-serif;
  font-size: 30px;
  font-weight: 300;
  padding: 40px;
  padding-left: calc(40px + env(safe-area-inset-left, 0px));
  padding-right: calc(40px + env(safe-area-inset-right, 0px));
  /* On phones the page runs behind the browser toolbar and home
     indicator. The extra padding keeps the text above them while the
     photo and shade still reach the bottom of the screen. */
  padding-bottom: calc(40px + 100vh - 100svh + env(safe-area-inset-bottom, 0px));
  position: absolute;
  width: 100vw;
  z-index: 0;
}

/* Darkens the photo behind the text so it stays readable over the bright
   water. The fade starts --fade-start above the text box and eases in over
   --fade, overlapping the first lines of text. */
.content::before {
  --fade: 260px;
  --fade-start: 100px;
  background: linear-gradient(
    to bottom,
    rgb(0 0 0 / 0%),
    rgb(0 0 0 / 6%) calc(var(--fade) * 0.2),
    rgb(0 0 0 / 18%) calc(var(--fade) * 0.4),
    rgb(0 0 0 / 33%) calc(var(--fade) * 0.6),
    rgb(0 0 0 / 46%) calc(var(--fade) * 0.8),
    rgb(0 0 0 / 55%) var(--fade),
    rgb(0 0 0 / 70%)
  );
  bottom: 16px;
  content: '';
  left: 16px;
  position: absolute;
  right: 16px;
  top: calc(var(--fade-start) * -1);
  z-index: -1;
}

.content a {
  color: var(--main-color);
  transition: background-color 0.1s ease;
  text-decoration-thickness: 2px;
}

.content a:hover {
  background-color: #dadacc31;
}

.group {
  margin-top: 10px;
}

/* Now playing */

.now-playing {
  position: relative;
}

.now-playing__loading {
  display: flex;
  left: 0;
  opacity: 1;
  position: absolute;
  top: 0;
  transition: opacity 0.3s ease-out;
}

.now-playing__rendered {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

/* Keeps the space after the "Now Playing" label from collapsing while
   this is empty, so the row doesn't shift sideways when a track loads. */
.now-playing__rendered:empty::before {
  content: '\2060';
}

.now-playing__img {
  height: 50px;
  left: 0;
  margin-left: 5px;
  margin-right: 10px;
  position: absolute;
  top: -5px;
  vertical-align: middle;
  width: 50px;
}

.now-playing--loaded .now-playing__loading {
  opacity: 0;
}

.now-playing--loaded .now-playing__rendered {
  opacity: 1;
  transition-delay: 0.1s;
}

.now-playing--song-playing .now-playing__rendered {
  padding-left: 65px;
}

.now-playing .spinner {
  margin-right: 5px;
  vertical-align: top;
}

@media screen and (max-width: 500px) {
  .logo {
    height: 150px;
    width: 150px;
  }

  .content {
    font-size: 14px;
  }

  .now-playing {
    display: block;
  }

  .now-playing__loading {
    align-items: center;
    margin: 10px 0 0;
    position: static;
  }

  .now-playing__rendered {
    align-items: center;
    left: 0;
    position: absolute;
    top: 0;
  }

  .now-playing__img {
    float: left;
    margin: 0 10px 0 0;
    position: static;
  }

  .now-playing--song-playing .now-playing__rendered {
    padding: 0;
  }
}
