:root {
  --text-color: white;
  --body-bg: #222;
  --highlight: #f0ece5;
  --media-size: 260px;

  --header-lg: 70px;
  --header-sm: 116px;

  --panel-width: 350px;
  --panel-width-current: 350px;

  --duration-fast: 0.15s;
  --duration-slow: 0.25s;
  --duration-panel: 0.45s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  background-color: var(--body-bg);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-inline: 0;
  padding-bottom: 20px;
  overscroll-behavior: none;
  scrollbar-gutter: stable;
  font-size: clamp(18px, 2vw, 20px);
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  &:has(#collection-url:focus) {
    #title,
    #settings,
    #detail-container,
    main {
      filter: blur(10px);
      opacity: 0.3;
      pointer-events: none;
    }

    .header-main {
      opacity: 0;
    }

    #background img {
      opacity: 0.3;
    }
  }
  &:has(#timeline-list:empty) {
    #settings {
      display: none;
    }
  }
  &.panel-dragging {
    header,
    #timeline-wrapper {
      pointer-events: none;
    }
    #detail-container {
      box-shadow: 0 0 50px #00000060;
    }
  }
}

a {
  color: inherit;
  text-decoration: none;
  &:hover {
    text-decoration: underline;
  }
}

button {
  cursor: pointer;
  &:disabled {
    pointer-events: none;
    opacity: 0.3;
  }
}

a,
button,
select {
  &:focus-visible {
    outline: 1px solid white;
  }
}

#main-wrapper {
  flex-direction: row;
  width: 100%;
  @media (width < 550px) {
    padding-bottom: 60px;
  }
}

#timeline-wrapper {
  align-items: center;
  width: 100%;
}

#background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  img {
    position: absolute;
    top: -20vmax;
    left: -20vmax;
    right: -20vmax;
    bottom: -20vmax;
    width: 150vmax;
    height: 150vmax;
    object-fit: cover;
    opacity: 0.6;
    filter: blur(25px);
    transform-origin: center;
    transition: opacity var(--duration-fast);
  }
}

footer {
  transition: all var(--duration-fast);
  text-align: center;
  font-size: 11px;
  opacity: 0.6;
  margin-top: 20px;
  body:has(#detail-container.active) & {
    pointer-events: none;
  }
}

#error-box {
  position: fixed;
  bottom: 20px;
  font-size: 15px;
  font-weight: bold;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(193, 1, 1, 0.65);
  backdrop-filter: blur(10px);
  padding: 1em 1.5em;
  border-radius: 1em;
  color: white;
  z-index: 50;
  transition:
    transform 0.25s ease 0.25s,
    opacity 0.25s ease;
  opacity: 0;

  &.on-screen {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.browser-warning {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 1em 2em 1.5em;
  color: white;
  font-size: 14px;
  backdrop-filter: blur(10px);
}

.browser-warning .icon {
  display: inline-block;
  height: 2.5em;
  width: 2.5em;
  margin-bottom: 0.5em;
}

.browser-warning p {
  margin: 0;
  line-height: 1.3;
}

body {
  .browser-warning {
    display: none;
  }
}
